Room Finder
Implementation

Introduction

To initialise the Room finder engine, you first need to make sure you have loaded the Roomstay SDK. If you haven't done so, please refer to the Getting Started guide.

Roomstay widgets will need a target, which is a HTML element that the widget will be rendered into. You can create a target by adding a HTML element with an id attribute, and then use the id to create a target object.

<div id="roomstay-target"></div>
var target = document.getElementById('roomstay-target')
// Initialise a new Room Finder engine, and assign the targeted div to it
const engine = new roomstay.BookingWizardEngine(target)
engine.setConfig({
  onSubmit: (hotel) => {
    console.log(hotel)
  },
  properties: {
    'Your Company': [
      {
        id: 1,
        name: 'Your Hotel',
      },
    ],
  },
})
 
// This actually renders the engine into DOM
engine.start()