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 Installing the client
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

Installing the client

Load client.js from the Entase CDN, then create an instance. There is no package to install and no build step.

description View as Markdown

The client ships from the Entase CDN as a single file. There is no npm package, no bundle to build, and no dependency to keep up to date — you always get the current version.

HTML
1
<script src="https://js.entase.com/client.js"></script>

Loading the script defines a global Entase class. It does nothing else on its own: no network requests, no DOM changes, nothing rendered. Everything starts when you create an instance.

Creating an instance

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

Create one instance per page and reuse it for every event. The constructor registers a message listener on the window and begins detecting which checkout mode your domain is allowed to use, so creating several instances means duplicated listeners and duplicated detection calls for no benefit.

Every option has a default, so new Entase() with no arguments is valid — but without pk the client cannot verify that your domain may use inline checkout, and will always fall back to a pop-up window. See Checkout modes.

Loading the script asynchronously

If you load client.js with async or defer, the class will not exist yet when your inline script runs. The library dispatches an entase:ready event on window once it has loaded, so wait for it:

HTML
123456789
<script src="https://js.entase.com/client.js" async></script>
<script>
  let entase = null;

  const init = () => { entase = new Entase({ pk: 'YOUR_PUBLISHABLE_KEY' }); };

  if (typeof Entase !== 'undefined') init();
  else window.addEventListener('entase:ready', init);
</script>

The typeof check first matters: if the script has already finished loading, entase:ready has already fired and listening for it would wait forever.

Cleaning up

In a single-page application, call destroy() when the view that owns the instance unmounts:

JavaScript
1
entase.destroy();

This removes the window listeners the client registered. A destroyed instance cannot be reused — calling book() on it logs an error and does nothing. Create a new instance instead.

Content Security Policy

If your site sends a Content-Security-Policy header, the checkout needs:

  • script-src https://js.entase.com — to load the library.
  • frame-src https://www.entase.com — the checkout renders in an iframe in pane mode.
  • connect-src https://www.entase.com — the client calls the Entase API to determine the allowed checkout mode.

Without frame-src, pane mode produces an empty panel. Without connect-src, mode detection fails and every checkout opens as a pop-up.

Previous Overview Next Constructor options
Was this article helpful?
On this page
  • Creating an instance
  • Loading the script asynchronously
  • Cleaning up
  • Content Security Policy
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