AI Chat Embed Demo

This page demonstrates how to embed the AI Chat component on any website.

Method 1: Using Auto-Initialize

Add a container with data attributes and the script will automatically initialize:

<div 
  id="ai-chat-1" 
  data-aichat-container 
  data-aichat-theme-color="#0070f3"
  data-aichat-welcome-message="Hello! How can I help you today?"
></div>

<script src="${process.env.NEXT_PUBLIC_BASE_URL}/embed.js"></script>

Live Example:

Method 2: Using JavaScript API

Initialize the chat component programmatically with custom configuration:

<div id="ai-chat-2"></div>

<script src="${process.env.NEXT_PUBLIC_BASE_URL}/embed.js"></script>
<script>
  document.addEventListener('DOMContentLoaded', function() {
    if (window.AIChat) {
      window.AIChat.init('ai-chat-2', {
        themeColor: '#6d28d9',
        welcomeMessage: 'Hello! I was initialized via JavaScript API.',
        maxHeight: '400px'
      });
    }
  });
</script>

Live Example:

Configuration Options

The following configuration options are available: