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
| Parameter | Default | Description |
|---|---|---|
data-widget-token | none | Workspace token. Required. |
data-widget-id | none | Widget id. |
data-container | ask-ai-prosecaptain | The id of the element the button renders into. |
data-theme | light | light or dark. |
data-widget-server-url | https://widget-api.prosecaptain.com | Widget server URL. |
Your own button or link
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.