← Back to Docs

Widget Button (Public Mode)

Floating chat button widget for public knowledge base access

📍 You're viewing a demo page

The chat button widget is embedded on this page. Look for the chat button in the bottom-right corner!

How to Embed (CDN)

Add this code to any website to embed the public chat button:

<link rel="stylesheet" href="https://your-api-url.com/chatter.css">
<script src="https://your-api-url.com/chatter.js"></script>

<script>
  new Chatter.ChatButton({
    host: 'your-api-url.com',
    mode: 'public',
    apiKey: 'YOUR_API_KEY_HERE',
    position: 'bottom-right',
    label: '💬',
    chatConfig: {
      title: 'Chat with us',
      subtitle: 'We typically reply in a few minutes'
    }
  });
</script>

NPM Installation

Or install via npm for modern JavaScript projects:

npm install @diegoaltoworks/chatter
import { ChatButton } from '@diegoaltoworks/chatter';
import '@diegoaltoworks/chatter/style.css';

new ChatButton({
  host: 'your-api-url.com',
  mode: 'public',
  apiKey: 'YOUR_API_KEY_HERE',
  position: 'bottom-right'
});

How This Demo Works

This page embeds the Chatter.ChatButton widget with the following code:

<link rel="stylesheet" href="https://your-api-url.com/chatter.css">
<script src="https://your-api-url.com/chatter.js"></script>

<script>
  new Chatter.ChatButton({
    host: 'your-api-url.com',
    mode: 'public',
    apiKey: 'YOUR_API_KEY_HERE',
    position: 'bottom-right',
    label: '💬',
    chatConfig: {
      title: 'Public Demo',
      subtitle: 'Ask me anything'
    }
  });
</script>

Configuration Options

💡 Try it now!

Click the chat button in the bottom-right corner to start chatting.