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. Visitors can ask questions and get instant answers without leaving your page.
Includes: Realtime streaming · Chat persistence · Multi-language (EN/VI) · Dark mode · Markdown & code blocks · Feedback 👍👎 · Mobile fullscreen
Get the Embed Code
- Go to Integrations in the sidebar of the Admin Panel
- Copy the 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 before the closing
</body>tag in your HTML
Attributes
| Attribute | Required | Description |
|---|---|---|
data-assistant-id | ✅ | Your assistant's UUID (from Admin Panel) |
data-api-base | ✅ | API server URL |
data-lang | ❌ | UI language: en or vi. Auto-detected by default |
If your site has <html lang="vi">, the widget automatically displays in Vietnamese — no need for data-lang.
Where to Add the Code
- WordPress — Appearance → Theme Editor → Footer
- HTML — Before
</body>in your HTML file - React/Next.js — Use
next/scriptwithstrategy="lazyOnload"
Configure Embed Domains
The widget only works on registered domains:
- Go to Integrations → Embed Widget Domains
- Enter the domain (e.g.,
www.mysite.com) - Click Add → Save
If the domain is not registered, the widget cannot connect and chat will not work.
Features
Chat persistence
Messages are saved to localStorage — refreshing the page won't lose them. Tap ✏️ in the header to start a new conversation.
Streaming & status
Responses appear character-by-character in realtime, with processing status ("Searching knowledge base...") and follow-up suggestions.
Markdown
Supports tables, code blocks with language labels + copy button, blockquotes, lists. Links open in a new tab automatically.
Error handling
Shows clear messages when rate-limited, network errors, or server issues occur — with a Try again button when possible.
Dark mode & Responsive
Automatically matches system appearance. Goes fullscreen on mobile (≤ 480px).
The embed widget is available on the Pro plan and above. Free plan users can use the hosted chat at support.assistantcore.com.