Overview
The AI Chat SDK (@sleek/ai-chat-sdk) enables web applications to integrate intelligent, context-aware AI chat capabilities. The SDK provides a beautiful chat interface with AI-powered recommendations and merchant offers, along with flexible entry points like floating badges and inline inputs to engage users.
Key capabilities
- Chat interface: Full-featured chat panel with AI conversation interface
- Multiple entry points: Floating badge and inline input to engage users
- Context-aware AI: Optional page context for smarter, relevant responses
- Event system: Comprehensive events for all user interactions
- Data integration: Display offer redirect URLs and cashback offers in conversations
- Full customization: Brand colors, logos, fonts, and light/dark mode support
- Multiple package formats: NPM package or IIFE script injection
- Shadow DOM isolation: Prevents styling conflicts with your application
Prerequisites
Before integrating the SDK, ensure your project meets these requirements:- Modern browser with ES6+ support (Chrome 100+, Firefox 100+, Safari 15+, Edge 100+)
- Node.js 18+ and package manager (pnpm, npm, or yarn) for NPM installation
Installation
- NPM / PNPM
- IIFE (Script Injection)
Configure npm registry
Add the registry to your
.npmrc file:.npmrc
Contact [email protected] to receive your authentication token.
Quick start
Here’s a minimal example to get the SDK running in your application:SDK methods
initializeAiChatSdk
Initializes the SDK with your API key and configuration options.apiKey: Your API key for authenticationoptions: Configuration options (optional)listeners: Array of event listener functions (optional)
getAiChatSdk
Retrieves the initialized SDK instance.initializeChat
Opens the full chat panel with an optional initial message and default prompts.initialMessage: Optional message to send when opening the chatdefaultPrompts: Optional array of prompt suggestions to display
showBadge
Shows a floating badge with AI-generated prompt suggestions. When users interact with the badge, it opens the chat panel.query: Optional query to generate contextual promptsisOnboarding: Whether to show onboarding content (default: false)
showInline
Shows an inline input component that can be embedded in a container element. When users interact with the inline input, it opens the chat panel.query: Optional query to generate contextual prompts
Entry points
The SDK provides multiple entry points to engage users and open the chat panel:Direct chat
Open the chat panel directly usinginitializeChat(). Best for explicit “Open Chat” buttons or when you want to immediately start a conversation.
Floating badge
A compact badge that shows AI-generated prompts. Expands on hover and opens the chat panel when clicked. Great for non-intrusive engagement that encourages users to start a conversation.Inline input
An input field that can be embedded in any container element. When users type or click a prompt, the chat panel opens. Ideal for seamless integration with existing UI layouts.Build formats
The SDK is distributed in multiple formats for maximum compatibility:| Format | File | Use Case |
|---|---|---|
| IIFE | ai-chat-sdk.iife.js | Script tag or runtime script injection |
| ESM | ai-chat-sdk.js | Modern bundlers (Vite, Webpack, etc.) |
| CJS | ai-chat-sdk.cjs | Node or CommonJS environments |
.d.ts) for full IDE support.
Getting help
- Email support: [email protected]
- Sales inquiries: [email protected]

