Skip to main content
The widget exposes a global window.Bookster object that you can use to control it from your own JavaScript.

Open the widget

// Open the chat widget
window.Bookster.open();

// Open with a pre-filled message
window.Bookster.open({
  message: "I'd like to book a haircut for tomorrow"
});

Examples

Custom button

<button onclick="window.Bookster.open()">
  Chat with us
</button>

Open with context from another page element

<div class="service-card">
  <h3>Deep Tissue Massage</h3>
  <p>60 minutes — $120</p>
  <button onclick="window.Bookster.open({message: 'I want to book a Deep Tissue Massage'})">
    Book now
  </button>
</div>

Wait for widget to be ready

The widget fires a bookster-widget-ready event on the window when it has finished loading:
window.addEventListener("message", (event) => {
  if (event.data.type === "bookster-widget-ready") {
    console.log("Bookster widget is ready");
  }
});
The window.Bookster object is only available after the widget script has loaded. If you need to call it immediately, use the bookster-widget-ready event to know when it’s safe.