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

# Add chat to your website

> Install the Osvi AI chat widget and allow your site to connect

This guide adds a chat launcher to your website with one script tag. It uses anonymous chat; for signed-in customers, see [Logged-in users](/website-chat/server-mode) after this.

## 1. Turn it on and allow your site

In the chat agent, open **Channels → Web widget**:

1. Switch **Anonymous usage** on. It is off by default, and while it is off the widget does not appear.
2. Under **Allowed websites**, add your site's exact origin, for example `https://shop.example.com`. To try it on your computer first, tick **Allow localhost for testing**.
3. Press **Save** at the top right. Nothing is saved before that.

Every setting in the pane is explained in [Dashboard settings](/website-chat/dashboard-settings).

## 2. Add the widget

Copy the snippet from **Add it to your site → Website** in the same pane, or use this one with your agent's ID (the `agent_…` value shown under the agent name). Put it near the end of `<body>`.

```html theme={null}
<script>window.OsviChat=window.OsviChat||{q:[],open(){this.q.push(['open'])},close(){this.q.push(['close'])},toggle(){this.q.push(['toggle'])}};</script>
<script async data-agent="agent_yourAgentId" src="https://cdn.jsdelivr.net/npm/@osvi-ai/chat@0.1/dist/widget.js"></script>
```

The `@0.1` URL always serves the latest 0.1.x release. To pin an exact version or add Subresource Integrity, see [Production setup](/website-chat/production).

## 3. Check it works

Open a page of your site (or `http://localhost:…` with localhost allowed). The launcher appears in the bottom-right corner; open it and send a message. If the launcher does not appear, see [Troubleshooting](/website-chat/troubleshooting).

## Next

* Change the launcher, colours and header: [Customise the widget](/website-chat/customise).
* Before going live, read [Security and limits](/website-chat/security) and [Production setup](/website-chat/production).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.