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

ParameterDefaultDescription
data-widget-tokennoneWorkspace token. Required to chat with the assistant.
data-widget-idnoneWidget id. Without it, the first published widget in the workspace is used.
data-themelightTheme: light or dark.
data-widget-modechatMode: chat, faq or ask. For FAQ and Ask AI we recommend the dedicated scripts with data-container.
data-widget-server-urlhttps://widget-api.prosecaptain.comServer the widget and its API load from.
data-api-urlhttps://widget-api.prosecaptain.comBase API URL.

Content overrides

ParameterDescription
data-widget-titleTitle on the welcome screen.
data-widget-subtitleSubtitle on the welcome screen.
data-widget-questionsSuggested questions as JSON: [{"question": "…", "prompt": "…"}]. Without prompt, question is sent to the AI.
data-widget-colorPrimary colour, e.g. #63AD61.
data-widget-languageLabel language: pl, en, de, es, cs, sk, pt.
data-widget-linkSupport 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>