Skip to main content

Overview

The AI Chat Extension SDK provides extensive configuration options to control features, customize appearance, and integrate with your data sources. All configuration is passed during SDK initialization.

Initialization signature

Required parameters

apiKey

Type: string Your Pie AI API key for authentication with the chat and query classification services.
Contact support@onsleek.org to receive your API key.

Configuration options

featureControls

Control which SDK features are enabled.
Example:
  • Query classification only: Set both to false to only classify queries and emit events
  • Badge only: Enable badge to show prompts without full chat capability
  • Full experience: Enable both for complete AI chat functionality

platformControls

Control which platforms the SDK is enabled on. URL match patterns are handled internally based on these settings.
Example:
Supported platforms:
  • Google Search: google.com
  • ChatGPT: chatgpt.com
  • When enableGoogle is true, the SDK will run on Google Search pages
  • When enableChatGPT is true, the SDK will run on ChatGPT conversation pages
  • You can enable both platforms simultaneously
  • By default, only Google Search is enabled
Platform controls work independently from feature controls. You can enable platforms without enabling UI features to use query classification only.

chatConfig

Configure the chat panel behavior, AI backend, and appearance.
Example:

badgeConfig

Configure the chat badge behavior and appearance.
Example:

Layout configuration

Both chatConfig.layout and badgeConfig.layout support position and size configuration:
Use chatConfig.isFloating (defaults to true) to control whether floating panel styles (border, border-radius, box shadow) are applied to the chat panel.
Example:

dataProviders

Integrate your offer redirect urls and cashback data into chat conversations. Optional but recommended for monetization.
Type definitions:
Example:
Data providers must handle errors gracefully and return null (for offer redirect urls) or {} (for cashback) on failure. Never throw exceptions.
See the Data Providers guide for detailed implementation examples.

enableDebug

Enable detailed console logging for debugging.
Example:
Debug mode should be disabled in production builds to reduce console noise and improve performance.

skipManifestValidation

Skip automatic validation of manifest.json configuration.
Example:
By default, manifest validation is skipped. Set to false during development to validate that your manifest includes required permissions and web-accessible resources.

Complete configuration example

Here’s a complete example with all commonly used options:

Environment-specific configuration

For different environments (development, staging, production), use environment variables: