Getting started
Installing
The emBET SDK can be installed using your favorite package manager or CDN.
- Package Manager: https://www.npmjs.com/package/@livelike/embet
- CDN: https://unpkg.com/@livelike/embet
npm install @livelike/embet<script src="https://unpkg.com/@livelike/embet/dist/embet.umd.js"></script>
Versioning RecommendationWe 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 ProfileThe
initfunction 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.
Updated 14 days ago
