Embed Script
Add a chat widget to any website with a single script tag.
Installation
Add the following script tag to your website's HTML, just before the closing </body> tag:
<script
src="https://your-domain.com/widget.js"
data-agent-id="your-agent-id"
defer
></script>Configuration Options
Customize the widget behavior with data-* attributes:
| Attribute | Type | Default | Description |
|---|---|---|---|
data-agent-id | string | — | Your agent's unique ID (required) |
data-theme | light | dark | auto | auto | Widget color theme |
data-position | bottom-right | bottom-left | bottom-right | Widget position |
data-welcome | string | — | Override the welcome message |
data-expanded | boolean | false | Start with the widget open |
Example
<script
src="https://your-domain.com/widget.js"
data-agent-id="abc123"
data-theme="dark"
data-position="bottom-right"
defer
></script>Content Security Policy
If your site uses a CSP, add the following directives:
script-src 'self' https://your-domain.com;
frame-src 'self' https://your-domain.com;
connect-src 'self' https://your-domain.com;