Bit Integration
Embed Bit from the CDN and configure the widget.
Bit is delivered as an ES module from the Chatbyte CDN. This is the recommended integration path for almost every app.
CDN embed
<script type="module">
import { createBit } from 'https://cdn.chatbyte.ai/bit/spark.min.js';
const bit = await createBit('your-agent-id', {
apiOrigin: 'https://app.chatbyte.ai',
});
bit.open();
</script>Options
interface CreateBitOptions {
theme?: 'light' | 'dark' | 'auto';
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
primaryColor?: string;
assistantName?: string;
apiOrigin?: string;
initialToken?: string;
}
interface WidgetNotificationOptions {
id?: string;
text: string;
openOnClick?: boolean;
oncePerSession?: boolean;
}Notes
apiOrigindefaults tohttps://app.chatbyte.ai.initialTokenis optional and can pre-identify a user.theme: 'auto'follows system preferences.- Automatic launcher prompts are configured in Chatbyte settings. For page-specific prompts, call
bit.showNotification(options).
For detailed JavaScript examples, see the Bit Integration (JavaScript) guide.