Every data-* attribute of embed.js: token, theme, mode and content overrides.
The embed.js script reads its settings from data-* attributes. Content and appearance come from the widget settings in the app by default; the attributes let you override them on a given page.
Basics
| Parameter | Default | Description |
|---|
data-widget-token | none | Workspace token. Required to chat with the assistant. |
data-widget-id | none | Widget id. Without it, the first published widget in the workspace is used. |
data-theme | light | Theme: light or dark. |
data-widget-mode | chat | Mode: chat, faq or ask. For FAQ and Ask AI we recommend the dedicated scripts with data-container. |
data-widget-server-url | https://widget-api.prosecaptain.com | Server the widget and its API load from. |
data-api-url | https://widget-api.prosecaptain.com | Base API URL. |
Content overrides
| Parameter | Description |
|---|
data-widget-title | Title on the welcome screen. |
data-widget-subtitle | Subtitle on the welcome screen. |
data-widget-questions | Suggested questions as JSON: [{"question": "…", "prompt": "…"}]. Without prompt, question is sent to the AI. |
data-widget-color | Primary colour, e.g. #63AD61. |
data-widget-language | Label language: pl, en, de, es, cs, sk, pt. |
data-widget-link | Support link shown in the widget. |
Example
<script
src="https://widget-api.prosecaptain.com/embed.js"
data-widget-token="YOUR_TOKEN"
data-widget-id="WIDGET_ID"
data-theme="dark"
data-widget-language="en"
data-widget-title="Questions about our offer?"
data-widget-questions='[{"question":"How long does onboarding take?"},{"question":"Does it work with WordPress?"}]'
></script>