The web widget allows you to add an AI chat assistant directly to your website.

Installation

Add the widget script to your website:
<script src="https://widget.boty.chat/widget.js"></script>
<script>
  Boty.init({
    agentId: 'your-agent-id'
  });
</script>

Configuration Options

Boty.init({
  agentId: 'your-agent-id',
  
  // Appearance
  position: 'bottom-right', // or 'bottom-left'
  primaryColor: '#6366f1',
  
  // Behavior
  autoOpen: false,
  showBranding: true,
  
  // Pre-chat form
  collectUserInfo: true,
  requiredFields: ['name', 'email'],
  
  // Welcome message
  welcomeMessage: 'Hi! How can I help you today?'
});
</script>

Customization

Navigate to your agent’s Widget Customization page to configure:
  • Colors: Primary color, background, text colors
  • Position: Bottom-right or bottom-left
  • Avatar: Custom agent avatar
  • Welcome Message: Initial greeting
  • Pre-chat Form: Collect user information before chat
  • Suggested Questions: Quick-start prompts

Voice Support

Enable voice chat in the widget:
Boty.init({
  agentId: 'your-agent-id',
  enableVoice: true,
  voiceProvider: 'webrtc'
});

Events

Listen to widget events:
Boty.on('open', () => console.log('Widget opened'));
Boty.on('close', () => console.log('Widget closed'));
Boty.on('message', (msg) => console.log('New message:', msg));
Boty.on('conversation:start', (id) => console.log('Conversation started:', id));

Methods

// Open/close widget
Boty.open();
Boty.close();
Boty.toggle();

// Send message programmatically
Boty.sendMessage('Hello!');

// Reset conversation
Boty.reset();