Assistant CoreAssistant Core
Embed & Integrate

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

  1. Go to Web Widget in the sidebar of the Admin Panel
  2. 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>
  1. Paste it before the closing </body> tag in your HTML

Attributes

AttributeRequiredDescription
data-assistant-idYour assistant's UUID (from Admin Panel)
data-api-baseAPI server URL
data-langUI 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/script with strategy="lazyOnload"

Allow Websites

The widget only works on allowed website origins:

  1. Go to Web Widget → Allow Websites
  2. Enter the full origin (e.g., https://www.mysite.com)
  3. Click AddSave

Paths and query parameters are not allowed. Add production and preview websites separately.


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.

On this page