Bit by ChatbyteBit by Chatbyte

Bit Integration (JavaScript)

Load Bit from the CDN and initialize the widget.

Bit is delivered as an ES module from the Chatbyte CDN. This guide is the full JavaScript walkthrough.

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>

Bundler usage

const { createBit } = await import(
  /* webpackIgnore: true */
  'https://cdn.chatbyte.ai/bit/spark.min.js'
);

const bit = await createBit('your-agent-id', {
  apiOrigin: 'https://app.chatbyte.ai',
});

Options

interface CreateBitOptions {
  theme?: 'light' | 'dark' | 'auto';
  position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
  primaryColor?: string;
  assistantName?: string;
  apiOrigin?: string;
  initialToken?: string;
}

Notes

  • apiOrigin defaults to https://app.chatbyte.ai.
  • initialToken is optional and triggers identification on load.
  • theme: 'auto' follows the user’s system theme.

On this page