@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.
Before you start, ensure that you have your Sleek credentials on hand.
Contact support if you need help with your
credentials.
Installation
If you’re planning to use the SDK via script injection (IIFE), you do not need to install it via a package manager. Just follow the IIFE Usage section.
Install via NPM (CJS / ESM)
The@sleek/sdk package is hosted on Sleek’s private package repository.
Configure .npmrc
{YOUR_TOKEN_HERE} with your SDK access token.
Add to your project
IIFE Usage
If you’re injecting the SDK into pages (e.g., via script tags), you can use the IIFE bundle directly.Download SDK package
sdk.iife.js: The main SDK filef.js: A supporting script required for the SDK to function properly in-page
Inject into the Page
Make sure these files are injected into the page before any other scripts, ideally at the top of the<head>:
sleek object will be available on globalThis.
Initialization
CallinitializeSdk with your public Sleek API key to initialize the SDK:
Core Features
The@sleek/sdk provides a tab/page-agnostic interface that powers:
Refer to the TypeDoc reference for full API documentation.
Events
To listen for SDK events, pass an array of listener functions toinitializeSdk as the third argument:
SdkEvent.
File Formats
| 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 |
What’s Next
Once you’ve installed and initialized the SDK, you can extend your integration with:Enable coupon auto-apply
Learn how to enable coupon auto-apply.
Page classification
Learn how to enable page classification.
Product extraction
Learn how to enable product extraction.
Order extraction
Learn how to enable order extraction.
View TypeDoc
Browse the reference TypeDoc for the SDK.
Need help? Contact our support team.

