Getting started

Installing

The emBET SDK can be installed using your favorite package manager or CDN.

npm install @livelike/embet
<script src="https://unpkg.com/@livelike/embet/dist/embet.umd.js"></script>
ℹ️

Versioning Recommendation

We strongly recommend always using a specific SDK version and upgrading manually when new versions are released. Avoid using unpinned or “latest” versions, as automatic updates may introduce breaking changes or behavioral differences that can affect your application.


The HTML element embet-overlay needs to be added to your application in order for the SDK to be able to show the overlay within it. The element needs an attribute customid which represents your current event ID.

<embet-overlay customid="<your-event-id>"/>

To initialize the SDK, use the embet.init function. You must provide a Client ID as the clientId property in the function’s argument.

import embet from "@livelike/embet";

import {clientId} from './your-config'
 
embet.init({clientId}).then((profile) => {
  // This will generate a new profile
  console.log("Initialized");
});
ℹ️

User Profile

The init function creates a new profile and access token by default.

  • Each profile counts toward the monthly active user (MAU) count.
  • To avoid unnecessary new profiles, re-use access tokens for returning users.
  • For better integration and accurate user tracking, refer to the User Profiles section.