The Ask AI button is one button in your brand colour labelled “Ask AI”. A click opens the chat window, ready for typing.

Add the button

With the widget script already on the page, add a container and the Ask AI module where the button should go:

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

Parameters

ParameterDefaultDescription
data-widget-tokennoneWorkspace token. Required.
data-widget-idnoneWidget id.
data-containerask-ai-prosecaptainThe id of the element the button renders into.
data-themelightlight or dark.
data-widget-server-urlhttps://widget-api.prosecaptain.comWidget server URL.

Instead of the ready-made button you can use your own link. Add the pc-ask-question attribute to any link and a click opens the chat and sends that question:

<a href="#" pc-ask-question="How much does onboarding cost?">Ask about pricing</a>

More in JavaScript API.