Skip to main content

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 token
3

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:
Check the browser console for specific error messages.

”SDK already initialized” error

Symptom: Error when calling initializeAiChatSdk 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: Calling sdk.initializeChat() doesn’t show the chat panel Common causes:
  • Invalid or missing API key
  • SDK not initialized before calling initializeChat()
  • JavaScript errors in console
Solution:
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:
  1. Verify your API key is valid
  2. Check browser console for network errors
  3. Ensure you have internet connectivity
  4. Try clearing browser cache

Badge not appearing

Symptom: Calling sdk.showBadge() doesn’t show the badge Solution:
Check the browser console for errors. The badge may also be hidden if:
  • badgeConfig.allowExpand is set to false and there are no prompts
  • Layout position places it off-screen

Inline input not rendering

Symptom: Calling sdk.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:
Test by asking merchant-specific questions like “Show me deals on Amazon”

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:
Event listeners cannot be added after SDK initialization. They must be passed as the third parameter to initializeAiChatSdk().

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

Check console for detailed error messages
4

Check browser console

Look for 401/403 errors indicating authentication issues
If issues persist, contact support@onsleek.com

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 the brand configuration:
Common issues:
  • 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+
For best results, ensure users are on the latest browser version.

Debugging tips

Enable debug mode

Always start troubleshooting with debug mode enabled:
This provides detailed logs in the browser console.

Check SDK version

Verify you’re using the latest version:
Update if needed:

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 use getAiChatSdk() before calling initializeAiChatSdk(). Ensure SDK is initialized first:

“Data provider error”

  1. Ensure providers return correct types (null or {} on error)
  2. Add try-catch blocks to all providers
  3. 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
When contacting support, please include:
  • 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