
Installation
Add this script tag before the closing</body> tag on every page where you want the widget to appear:
Configuration
Customize the widget’s appearance and behavior with data attributes on the script tag.Position
| Attribute | Default | Description |
|---|---|---|
data-widget-position | "right" | Side of the screen: "left" or "right". |
data-bottom-offset | "1rem" | Distance from the bottom of the viewport. |
Theming
| Attribute | Description |
|---|---|
data-header-bg-color | Header background color (hex, e.g. #F6F7F9). |
data-header-text-color | Header text color. |
data-header-bot-name | Display name shown in the header. |
data-agent-image | URL for the bot’s avatar image. |
data-bot-bubble-bg-color | Background color of bot message bubbles. |
data-bot-bubble-text-color | Text color of bot message bubbles. |
data-user-bubble-bg-color | Background color of user message bubbles. |
data-user-bubble-text-color | Text color of user message bubbles. |
Data
| Attribute | Description |
|---|---|
data-token | Pre-generated access token for the thread. |
data-json-input | JSON string with initial data to send to the thread on creation. |
Full example
Opening a specific thread
By default, the widget creates a new thread for each session. To open an existing thread instead, generate a JWT token for that thread via the API and pass it usingdata-token:
JavaScript API
The widget exposes a globalwindow.PuppeteerChat object that you can use to control it programmatically.