Install and integrate the core SDK into any webpage or browser environment.
@sleek/sdk
package provides the foundational JavaScript SDK for Sleek, supporting multiple bundling formats (IIFE, ESM, CJS). You can use it directly in web pages via script injection or install it via a package manager in modern frontend setups.
This guide walks you through installation, setup, and core usage of the SDK.
@sleek/sdk
package is hosted on Sleek’s private package repository.
.npmrc
{YOUR_TOKEN_HERE}
with your SDK access token.
sdk.iife.js
: The main SDK filef.js
: A supporting script required for the SDK to function properly in-page<head>
:
sleek
object will be available on globalThis
.
initializeSdk
with your public Sleek API key to initialize the SDK:
@sleek/sdk
provides a tab/page-agnostic interface that powers:
Refer to the TypeDoc reference for full API documentation.
initializeSdk
as the third argument:
SdkEvent
.
Format | File | Use Case |
---|---|---|
IIFE | sdk.iife.js | Script tag or runtime script injection |
ESM | sdk.esm.js | Modern bundlers (Vite, Webpack, etc.) |
CJS | sdk.cjs.js | Node or CommonJS environments |