Overview
This guide covers common issues you may encounter when integrating the AI Chat SDK and how to resolve them.Installation issues
Package not found
Symptom:npm install or pnpm add fails with “package not found”
Solution:
1
Configure .npmrc
Add the registry configuration to your
.npmrc file:.npmrc
2
Add your token
Replace
{YOUR_TOKEN_HERE} with your authentication token3
Install the package
Contact support@onsleek.com if you need an authentication token.
Module not found
Symptom:Cannot find module '@sleek/ai-chat-sdk'
Solution: Verify your TypeScript configuration includes:
tsconfig.json
SDK initialization issues
SDK not initializing
Symptom: SDK initialization fails or throws error Solution: Enable debug mode to see detailed error messages:”SDK already initialized” error
Symptom: Error when callinginitializeAiChatSdk multiple times
Solution: The SDK returns the existing instance if already initialized. Use getAiChatSdk() to retrieve the existing instance:
UI issues
Chat panel not appearing
Symptom: Callingsdk.initializeChat() doesn’t show the chat panel
Common causes:
- Invalid or missing API key
- SDK not initialized before calling
initializeChat() - JavaScript errors in console
1
Enable debug mode
2
Check browser console
Open DevTools (F12) and look for error messages
3
Verify initialization
Chat panel appears blank
Symptom: Panel opens but shows blank content Solution:- Verify your API key is valid
- Check browser console for network errors
- Ensure you have internet connectivity
- Try clearing browser cache
Badge not appearing
Symptom: Callingsdk.showBadge() doesn’t show the badge
Solution:
badgeConfig.allowExpandis set tofalseand there are no prompts- Layout position places it off-screen
Inline input not rendering
Symptom: Callingsdk.showInline() doesn’t show the inline input
Solution: Ensure you’ve configured a valid container selector:
Data provider issues
Providers not being called
Symptom: Data providers never execute Solution: Ensure providers are configured correctly:Provider errors
Symptom: SDK stops working after provider throws error Solution: Always handle errors and return valid fallback values:Slow performance
Symptom: Chat feels sluggish or freezes Solution: Add timeouts to data providers (recommend 500ms):Event issues
Events not firing
Symptom: Event listeners are never called Solution: Ensure listeners are registered during initialization:Network issues
API requests failing
Symptom: Chat not responding, network errors in console Solution:1
Verify API key
Ensure your API key is correct and active
2
Check network
Verify you have internet connectivity
3
Enable debug mode
4
Check browser console
Look for 401/403 errors indicating authentication issues
Configuration issues
Colors not applying
Symptom: Custom colors don’t appear in the UI Solution: Verify you’re using the correct configuration structure:Logo not appearing
Symptom: Logo doesn’t show in the chat header Solution: Check thebrand configuration:
- URL not accessible (CORS issues)
- Invalid image format
- Image too large to load
Browser compatibility
The SDK supports modern browsers:- Chrome 100+
- Firefox 100+
- Safari 15+
- Edge 100+
Debugging tips
Enable debug mode
Always start troubleshooting with debug mode enabled:Check SDK version
Verify you’re using the latest version:Test in incognito mode
Test in incognito/private browsing to rule out:- Browser extension interference
- Cached data issues
- Cookie problems
Check the console
Always check the browser DevTools Console (F12) for:- Error messages
- Network failures
- SDK debug logs
Common error messages
”Invalid API key”
Your API key is incorrect or inactive. Verify your key and ensure it’s active.”AI Chat SDK not initialized”
You’re trying to usegetAiChatSdk() before calling initializeAiChatSdk(). Ensure SDK is initialized first:
“Data provider error”
- Ensure providers return correct types (
nullor{}on error) - Add try-catch blocks to all providers
- Never throw exceptions from providers
Getting help
If you’re still experiencing issues, contact our support team.Email support
Get help from our support team
Documentation
Review the full SDK documentation
- SDK version (
pnpm list @sleek/ai-chat-sdk) - Browser name and version
- Error messages from console (with
enableDebug: true) - Code snippet of your SDK initialization
- Steps to reproduce the issue

