Developer Documentation
Everything you need to seamlessly integrate SiteBot into your application. Browse our guides, API references, and configuration options.
On this page
Quick Start
After creating a chatbot on SiteBot, you receive a unique namespace. Simply add one script tag to your HTML and the widget loads automatically.
<script
src="https://sitebot.online/embed.js"
data-namespace="YOUR_NAMESPACE"
data-title="Support Assistant"
data-welcome="Hi! How can I help you today?"
data-position="right"
></script>Widget Options
All options are set as data- attributes on the script tag. You can fully customize the behavior and initial state of your chatbot without writing any complex code.
| Attribute | Default | Description |
|---|---|---|
| data-namespace | — | Your chatbot namespace (required) |
| data-title | "Chat Assistant" | Header title displayed at the top of the chat |
| data-welcome | "Hi there! Ask me anything." | Initial welcome message shown to users |
| data-position | "right" | Widget placement: left or right |
Theme Colors
Fine-tune every color in the widget to perfectly match your brand's aesthetics by overriding these defaults in the script tag.
React / Next.js Integration
If you are building a React or Next.js application, use the next/script component or a standard useEffect hook to load the widget asynchronously without blocking your main thread.
"use client";
import Script from "next/script";
export function ChatWidget() {
return (
<Script
src="https://sitebot.online/embed.js"
strategy="lazyOnload"
data-namespace={process.env.NEXT_PUBLIC_SITEBOT_NAMESPACE}
data-title="Support"
data-position="right"
/>
);
}JavaScript SDK
For advanced control, you can programmatically configure the widget at runtime via the globally injected window.SiteBot object. This is useful for single-page applications updating state dynamically.
window.SiteBot.configure({
title: "Sales Assistant",
welcome: "Interested in our enterprise plans?",
primaryColor: "#fa5d19",
theme: "dark",
});