Embed Chatbot Widget
Add an AI chatbot to any website with a simple code snippet.
Overview
Embed your AI assistant as a floating chat widget on any website. Users can ask questions and get instant answers without leaving your site.
Get the Embed Code
- Go to Assistant Settings → Embed tab
- Copy the embed snippet:
<script
src="https://cdn.assistantcore.com/embed/embed.js"
data-assistant-id="YOUR_ASSISTANT_ID"
data-api-base="https://api.assistantcore.com"
async
></script>- Paste it into your website's HTML, before the closing
</body>tag
Customization
You can customize the widget appearance with data attributes:
| Attribute | Description | Default |
|---|---|---|
data-assistant-id | Your assistant's ID (required) | — |
data-api-base | API server URL | https://api.assistantcore.com |
Where to Add the Code
WordPress
Go to Appearance → Theme Editor → Footer and paste the snippet.
HTML Site
Add it just before </body> in your HTML file.
React / Next.js
Add the script tag to your layout.tsx or use next/script:
<Script
src="https://cdn.assistantcore.com/embed/embed.js"
data-assistant-id="YOUR_ASSISTANT_ID"
data-api-base="https://api.assistantcore.com"
strategy="lazyOnload"
/>Configure Embed Domains
The widget only works on registered domains. If you're embedding the widget on a third-party website (not your assistant's custom domain or subdomain), you must register that domain first.
- Go to Integrations → Embed Widget Domains
- Enter the domain (without
https://), e.g.,www.mysite.com - Click Add → Save Domains
If the embed domain is not registered, the widget cannot connect to the API and chat will not work.
The embed widget is available on the Plus plan and above. Free plan users can use the hosted chat at chat.assistantcore.com.