How can I add the Hexabot Chat Widget to my website?
Hexabot is a self-hosted, fair-core AI workflow automation platform. Use it to build AI chatbots, conversational AI, and workflow-driven automations across channels.
The Hexabot Chat Widget adds a website chat widget to any website or web app. It connects your site to a Web Source in Hexabot v3.
Use this guide when you manage the site code directly. If you use WordPress, install the plugin instead.

Before you start
Pass the Source Ref as the widget sourceId.
How setup works
Create a Web Source for the site.
Add the Hexabot Chat Widget with your API URL and
sourceId.Pass
workflowIdonly when you want to override the source default workflow.
Create a separate Web Source for each website when domains, branding, or workflows differ.
Learn more in Channels and Sources and Web Source.
Step 1: Create a Web Source
Open Admin → Integrations → Channels.
Click Add.
Choose
web.Enter a clear source name.
Add the exact website origin to Allowed domains.
Set a Default workflow if this website should always start one workflow.
Copy Source Ref.
Save the source.
Use the copied Source Ref as the widget sourceId.
Step 2: Add the widget
The imperative Embed API is available starting with version 3.5.0
Use the CDN build for the quickest and most streamlined setup along with React 18 or 19.
Use the CDN build when you want the fastest setup.
Remove workflowId to use the Web Source default workflow.
Replace @latest with a fixed version when you want reproducible deploys.
Install the package:
Render the widget in your app:
Remove workflowId to use the Web Source default workflow.
Step 3: Verify the connection
Open the website and confirm the widget loads.
Then check these basics:
The Web Source is enabled.
The website origin matches Allowed domains exactly.
apiUrlpoints to your public Hexabot API.sourceIdmatches the copied Source Ref.
How workflow routing works
Hexabot resolves the workflow in this order:
Widget
workflowIdWeb Source Default workflow
Channel or workflow trigger behavior
Use workflowId only when the page should force a specific flow.
Web Source settings that affect the widget
Manage website behavior in the Web Source form.
Common settings include:
Allowed domains for website access control
Greeting message, window title, and avatar URL
Show emoji, show file, and show location
Persistent menu, disable input, and allowed upload MIME types
Maximum upload size is not a Web Source setting. Set it in the widget client with maxUploadSize and enforce it on the server.
Troubleshooting
Widget does not appear
Check that the widget script and stylesheet load. Then confirm the Web Source is enabled and sourceId matches the copied Source Ref.
Invalid API URL
Use the public Hexabot API URL. Include the API base path, such as https://example.com/api.
Invalid Source Ref
Copy the Source Ref from the Web Source form. Pass that value as sourceId.
Domain not allowed
Add the exact site origin to Allowed domains. Include the scheme, subdomain, and port when needed.
WebSocket blocked
The widget uses Socket.IO transport. If a proxy blocks WebSocket upgrades, allow them or set transport="polling".
Uploads not working
Confirm the Web Source allows the file MIME type. Then check server upload limits and the widget maxUploadSize value.
Styling conflicts
Load the widget stylesheet. If your site CSS still leaks into the widget, mount it inside a shadow root.
Related pages
Last updated
Was this helpful?