Knowledge Center Blog
  • Theme
  • Auto
  • Light
  • Dark
English en
Language ✕
  • Deutsche
  • Eesti
  • English
  • Español
  • Français
  • Hrvatski
  • Italiano
  • Latviešu
  • Lietuvių
  • Lëtzebuergesch
  • Malti
  • Nederlands
  • Português (BR)
  • Português (PT)
  • Română
  • Slovenčina
  • Slovenščina
  • Srpski
  • Suomi
  • Türkçe
  • Ελληνικά
  • Български
  • Русский
  • Українська
Log in
Developers Blog
Log in
Home Developers JavaScript client Events
Search
Developers
JavaScript client
  • Overview
  • Installing the client
  • Constructor options
  • Checkout modes
  • Opening the checkout
  • Events
  • Methods reference
  • Tracking and consent
  • Advanced embed options
  • Troubleshooting
REST API (v2)
PHP SDK
Node.js SDK
Python SDK
WordPress plugin
JavaScript client

Events

Listen for the checkout opening, closing and recording consent with on() and off(), and understand the one-listener-per-event rule.

description View as Markdown

The checkout reports what it is doing back to your page. Subscribe with on():

JavaScript
123
entase.on('checkout.ready', payload => {
  console.log('checkout open for', payload.context.eventID);
});

One listener per event name

on() stores one callback per event name. Registering a second callback for the same name replaces the first — it does not add to it:

JavaScript
12
entase.on('checkout.closed', a);
entase.on('checkout.closed', b);   // a is gone; only b runs

off() removes whatever is registered for a name. It ignores any callback you pass it, so off('checkout.closed', b) and off('checkout.closed') do the same thing.

If several parts of your page need to react to the same event, register one callback and fan out from inside it.

Subscribing to several events at once

Both methods accept a space-separated string or an array of names, registering the same callback for each:

JavaScript
12345
entase.on('checkout.ready checkout.closed', payload => {
  console.log(payload.name);
});

entase.off(['checkout.ready', 'checkout.closed']);

The payload

Every callback receives one object:

FieldTypeDescription
namestringThe event name, useful when one callback handles several.
contextobjectContains eventID — the event this checkout belongs to.
dataobjectEvent-specific detail.

Available events

NameWhen it fires
checkout.readyThe checkout has loaded and is ready to interact with. This is also when the client hands over the clientContext you passed to book().
checkout.closedThe checkout has closed. The client tears down the panel or window and clears the backdrop.
checkout.consentThe visitor answered the terms notice. data.consent is true when they accepted, and the client remembers it so the step is skipped next time.
JavaScript
1234567
entase.on('checkout.closed', () => {
  document.body.classList.remove('checkout-open');
});

entase.on('checkout.consent', payload => {
  if (payload.data.consent) console.log('terms accepted');
});

Listeners survive individual bookings

Listeners belong to the instance, not to a booking. Register them once, after creating the client, and they apply to every book() call. Use payload.context.eventID to tell bookings apart:

JavaScript
12345
const entase = new Entase({ pk: 'YOUR_PUBLISHABLE_KEY' });

entase.on('checkout.closed', payload => {
  refreshAvailability(payload.context.eventID);
});

Calling destroy() stops all of them — the instance stops listening for messages from the checkout entirely.

Messages from other sources are ignored

The client only accepts messages from the Entase checkout origin, so unrelated postMessage traffic on your page will never reach your callbacks.

Previous Opening the checkout Next Methods reference
Was this article helpful?
On this page
  • One listener per event name
  • Subscribing to several events at once
  • The payload
  • Available events
  • Listeners survive individual bookings
  • Messages from other sources are ignored
Learn how to Entase.
© 2026 Entase, Inc.

Entase

  • Events
  • Sign up

Platform

  • Pricing
  • Global reach
  • Integration
  • Marketing tools
  • Booking tools
  • Collaboration

Use cases

  • Theater and opera
  • Concerts and parties
  • Expos, fairs and festivals
  • Museums and attractions
  • Tours and experiences
  • Workshops and seminars
  • Fundraising
  • Tournaments

Knowledge center

  • Organizers
  • Attendees
  • Developers
  • Blog

Legal

  • Terms of use
  • Privacy policy
  • Cookies policy
search Questions? Search
auto_awesome LLM? Read llms.txt
support_agent Need help? Start chat