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 Opening the checkout
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

Opening the checkout

The book() method opens the checkout for one event, and accepts per-call overrides plus a client context you can carry through to your own systems.

description View as Markdown

book() is the method that opens the checkout. Everything else on the client configures it or observes it.

JavaScript
12
entase.book(eventID);
entase.book(eventID, options);

eventID is the identifier of the scheduled event to sell. It is the same id used in your event's share and embed codes.

The call returns immediately — it opens the panel or window and does not wait for the visitor to finish. Use events to react to what happens next.

Options

NameTypeDefaultDescription
checkoutModestringinstance value'pane' or 'popup' for this booking only.
clientContextobjectnullArbitrary data handed to the checkout once it is ready. See below.
collectConsentbooleaninstance valueWhether to ask the visitor to accept the terms notice.
backdropbooleaninstance valueWhether to dim the page behind the checkout.
backdropColorstringinstance valueColour of the dimmed area.
paneobjectinstance value{ width, height } for the inline panel.
popupobjectinstance value{ width, height } for the pop-up window.

Anything you leave out falls back to the value the instance was constructed with, so per-call options are additive rather than a replacement set.

JavaScript
12345
entase.book('EVENT_ID', {
  pane: { width: '60vw' },
  backdrop: false,
  clientContext: { source: 'homepage-hero' }
});

Client context

clientContext is an object of your own design. The client holds it until the checkout signals that it is ready, then hands it over. Use it to carry information that only your page knows — which button was clicked, which campaign a visitor arrived on, an internal customer reference — through to the checkout session.

The context is stored per event id, so booking two different events from the same page keeps their contexts separate.

Do not put anything sensitive in it. It travels to the checkout through the browser and is visible to anyone inspecting the page.

Opening several events from one page

One instance handles any number of events. Create it once and pass a different id each time:

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

document.querySelectorAll('[data-event-id]').forEach(button => {
  button.addEventListener('click', () => {
    entase.book(button.dataset.eventId, {
      clientContext: { source: button.dataset.source }
    });
  });
});

After the client is destroyed

Calling book() on an instance you have already destroyed logs an error to the console and opens nothing. This is deliberate — a destroyed instance no longer listens for messages from the checkout, so the window it opened could not be closed or observed. Create a new instance instead.

Closing the checkout

The visitor closes the checkout themselves: Escape or a click on the dimmed area in pane mode, the window controls in pop-up mode. The checkout also closes itself when a booking completes.

There is no public method to close it from your code. If you need to know when it closed, listen for the checkout.closed event.

Previous Checkout modes Next Events
Was this article helpful?
On this page
  • Options
  • Client context
  • Opening several events from one page
  • After the client is destroyed
  • Closing the checkout
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