> ## Documentation Index
> Fetch the complete documentation index at: https://docs.circuit.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Chat widget overview

> Embed a Circuit agent on your website as a chat widget that answers visitor questions from your indexed content.

The Circuit chat widget lets website visitors talk to one of your agents without signing in to Circuit. Paste one script tag into your page, and Circuit renders a launcher bubble in a corner of your site. Clicking the bubble opens a chat interface inside an iframe.

## How it works

1. Your page loads `launcher.js` from `chat-embed.circuit.ai`. The launcher is a small (\~2 KB) script that reads the `apiKey` from its own `<script src>` URL.
2. The launcher fetches `GET /chat-bot/config` from the Circuit API using the key. This call returns the agent's name, branding, and feature settings. If the call fails for any reason, the launcher logs a warning and renders nothing.
3. On success, the launcher renders a fixed-position bubble (64×64 px, `z-index: 2147483647`) using the branding from the config.
4. When a visitor clicks the bubble, the launcher injects an `<iframe>` pointing to `chat-embed.circuit.ai/embed?apiKey=…`. The iframe hosts the chat SPA.
5. The launcher and SPA communicate using versioned `postMessage` envelopes (`{ version: 1, type, payload }`). The launcher forwards the config to the SPA after the SPA signals it is ready.

Visitors are anonymous. The widget does not identify visitors or require a login.

## What you need

* A configured agent whose reference scope covers the content you want visitors to ask about.
* An agent API key, created on the agent's Chatbot settings page.
* The hostname of every site that will embed the widget, added to the key's Allowed Website Domains list. Requests from any other origin are rejected with 403.

Setup takes a few minutes. Follow the [quickstart](/it/chat-widget/quickstart).

## Current limitations

The widget does not currently support:

* Identifying signed-in visitors or passing user attributes to the agent.
* File uploads from visitors.
* More than one agent per widget, or more than one widget per page.
* Custom fonts, custom CSS, or hiding built-in controls.

<Note>
  If your use case needs capabilities beyond what the widget supports, contact the Circuit team.
</Note>

## Learn more

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/it/chat-widget/quickstart">
    Create a key, allow your domains, and add the script tag.
  </Card>

  <Card title="Configuration" icon="sliders" href="/it/chat-widget/configuration">
    Branding, position, welcome message, and other settings.
  </Card>

  <Card title="Security" icon="shield" href="/it/chat-widget/security">
    Everything a security review needs: sessions, CSP, domains, and rate limits.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/it/chat-widget/troubleshooting">
    Fixes for the most common setup problems.
  </Card>
</CardGroup>
