The FAQ block is an inline element: a title, a subtitle and the suggested questions as buttons. Clicking a question opens the chat window and sends that question to the assistant right away.

Add the block

With the widget script already on the page, add a container and the FAQ module where the block should go. The module reuses the loaded widget and opens answers in the same chat window.

<div id="faq-ai-prosecaptain"></div>
<script
  src="https://widget-api.prosecaptain.com/embed-faq-ai.js"
  data-widget-token="YOUR_TOKEN"
  data-widget-id="WIDGET_ID"
  data-container="faq-ai-prosecaptain"
  data-widget-server-url="https://widget-api.prosecaptain.com"
></script>

Block content

  • The title and subtitle are Widget title and Widget subtitle from the app settings.
  • The buttons are the Suggested questions. Each question can have its own prompt, the text actually sent to the AI.
  • If the widget has no suggested questions, the block is not shown.

Parameters

ParameterDefaultDescription
data-widget-tokennoneWorkspace token. Required.
data-widget-idnoneWidget id.
data-containerfaq-ai-prosecaptainThe id of the element the block renders into. If it is missing, the block goes to the end of the page.
data-themelightlight or dark.
data-widget-server-urlhttps://widget-api.prosecaptain.comWidget server URL.

Other content and appearance (colour, language) come from the widget settings in the app.