Add an AI-powered expert chat to any website with a single script tag.
No backend required on your site — authentication, billing, and session management all happen on SageTube.
Paste this snippet before </body> on any page:
<script
src="https://sagetube.ai/embed/widget.js"
data-expert-token="YOUR_EXPERT_TOKEN"
async
></script>
A floating chat bubble appears in the bottom-right corner. Clicking it opens a chat panel powered by your Expert's knowledge base.
/s/{token})The expert token is the same token used in your public shared link. It is not a secret — it identifies which Expert to chat with.
<script
src="https://sagetube.ai/embed/widget.js"
data-expert-token="YOUR_EXPERT_TOKEN"
data-position="bottom-right"
data-primary-color="#6366f1"
data-greeting="Ask me anything!"
async
></script>
| Attribute | Required | Default | Description |
|---|---|---|---|
data-expert-token |
Yes | — | Your Expert's public sharing token |
data-position |
No | bottom-right |
bottom-right or bottom-left |
data-primary-color |
No | #0D9488 |
Bubble and accent color (any CSS color) |
data-greeting |
No | Ask me anything! |
Initial greeting shown in the chat panel |
sagetube.ai. No credentials are ever exposed to your page.localStorage on your domain.The widget dispatches CustomEvents on the widget host element that bubble up to document. You can listen for these to react to chat activity:
document.addEventListener('sagetube:message', (e) => {
console.log('New message:', e.detail);
});
| Event | Payload | Description |
|---|---|---|
sagetube:ready |
{ height } |
Chat loaded and ready |
sagetube:message |
{ role } |
A message was sent or received |
sagetube:resize |
{ height } |
Chat content height changed |
sagetube:limit |
{ type } |
Query limit reached (daily or rate) |
sagetube:error |
{ code } |
Expert unavailable or balance empty |
sagetube:close |
{} |
User closed the chat |
localStorage on your domain (no cookies).For server-side integrations or full control over the chat UI, use the SageTube API instead.
SageTube Support
Hi! I'm SageTube's AI assistant. Ask me anything about the product, billing, or troubleshooting.