Set up the widget
1
Create a chatbot key
In Circuit, open the agent you want to embed and go to its Chatbot settings. Create a new chatbot key with a descriptive name, for example “Company website”.
2
Add your domains to the allowed list
In the Allowed Website Domains section, add the hostname of every site that will embed the widget, for example
www.example.com.This step is required. The server checks the Origin header on every request and rejects any hostname not on the list with 403. A key with an empty list rejects all requests.Domain matching rules:- Enter hostnames only:
www.example.com, nothttps://www.example.comorwww.example.com:443. - Each hostname must match exactly.
example.comdoes not coverwww.example.com. Add both if you serve both. - Matching is case-insensitive and ignores ports.
- For local testing, add
localhost.
3
Copy the script tag
The Chat Widget HTML section on the Chatbot settings page shows a ready-to-copy The
<script> tag. Paste it inside the <body> of your page, ideally near the closing tag:async attribute keeps it off your critical render path. The script URL is stable and never changes.4
Verify it works
Open your site in a browser. A bubble should appear in the corner of the page. Click it, send a test question, and confirm the agent streams back an answer.If the bubble is missing or messages fail, see troubleshooting.
Full page example
Framework installs
The widget is framework-agnostic. Any approach that puts the script tag in the rendered page works.In single-page apps, load the script once at the application root rather than inside a routed page component. The widget persists across client-side navigation. Re-injecting the script tag has no effect because the launcher is idempotent.
CMS and tag manager installs
Google Tag Manager
Google Tag Manager
Create a new tag of type Custom HTML, paste the script tag, and set the trigger to All Pages. GTM injects the script on page load.
WordPress
WordPress
Add the script tag to your theme’s footer using your theme’s custom code setting (often under Appearance) or a header/footer code plugin. Avoid pasting it into individual posts.
Shopify
Shopify
In your admin, go to Online Store, then Themes, then Edit code. Open
theme.liquid and paste the script tag immediately before the closing </body> tag. Add your .myshopify.com hostname to the allowed domains list if you need the widget to work in theme preview.Webflow
Webflow
In Site settings, open the Custom code tab and paste the script tag into the Footer code section, then publish. Add your
.webflow.io staging hostname to the allowed domains list if you test on the staging URL.your-store.myshopify.com or your-site.webflow.io.
Testing on staging and localhost
The allowed domains check applies everywhere the widget runs, including local and staging environments:- Add
localhostto test locally. Ports are ignored, solocalhostcoverslocalhost:3000and any other port. - Add your staging hostname alongside your production hostname.
- Consider a separate key per environment so you can revoke or rotate it independently.
Next steps
Configuration
Customize branding, position, and welcome message.
Security
What your security team needs to review before launch.