> For the complete documentation index, see [llms.txt](https://docs.limio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.limio.com/ai/chat-embed/setup.md).

# Setup

Guest chat works with no backend integration: paste one script tag and ask Limio to allow your site's origin.

## 1. Paste the snippet

Add the script tag to every page where chat should appear, just before `</body>`:

```html
<script src="https://<your-limio-domain>/__core/embed/bootstrap.js" defer></script>
```

`<your-limio-domain>` is the domain your Limio shop is served from, for example `shop.example.com`. Your Limio contact can confirm it.

The domain the script loads from determines which Limio environment — and so which agent — the chat connects to. There is no tenant attribute and no API key in the snippet; the URL is the configuration.

| Attribute         | Required | Value                                                                                                                                                                                                                            |
| ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data-fab`        | no       | `auto` (default) shows the chat launcher bubble. `never` hides it; you then open chat from your own code with [`LimioChat.open()`](/ai/chat-embed/api-reference.md).                                                             |
| `data-api-origin` | no       | Only needed when the script is **not** loaded from your Limio domain — see [Serving the bundle yourself](#serving-the-bundle-yourself). When the script loads from your Limio domain, the API origin is the script's own origin. |

The widget mounts itself into the page. If you want to control where, add `<div id="limio-chat"></div>` and the widget mounts there instead.

{% hint style="danger" %}
Your pages must be served over HTTPS. Browsers only expose the crypto APIs the embed uses for identity in secure contexts.
{% endhint %}

## 2. Allow your origin

Ask your Limio contact to add your site's origin to the tenant's allowed origins, for example `https://www.example.com`. Until this is done, the widget loads but every chat request is rejected, and the browser console shows blocked requests to the chat API.

## Check it works

Load the page. You should see the chat launcher in the bottom-right corner. Open it and send a message; the agent replies. Reload the page: the conversation session survives, because the visitor's session token is kept in your site's localStorage (key `limio.chat.<api-host>.session`, 24-hour expiry, renewed automatically).

If the launcher appears but messages fail, the most common cause is the origin allowlist (step 2). Open the browser console: the embed logs the reason for any failure with an error code your Limio contact can act on.

## Serving the bundle yourself

If your site can't load third-party scripts (a strict CSP, a procurement rule), you can serve the bundle from your own static hosting instead. Limio gives you two files:

| File               | What it is                                                                                           |
| ------------------ | ---------------------------------------------------------------------------------------------------- |
| `bootstrap.js`     | The small loader your page references                                                                |
| `widget.<hash>.js` | The chat widget, lazy-loaded by the bootstrap. Styles are built in; there is no separate stylesheet. |

Put both **in the same directory**, with the filenames unchanged: the bootstrap finds the widget bundle relative to its own URL. Then point the snippet at your copy and add `data-api-origin` so chat requests still reach Limio:

```html
<script
  src="/assets/limio/bootstrap.js"
  data-api-origin="https://<your-limio-domain>"
  defer></script>
```

`data-api-origin` is the origin only, with no path and no trailing slash. A self-hosted bundle doesn't pick up Limio releases automatically — you replace the files when Limio ships an update. Prefer the Limio-hosted snippet unless you have a reason not to.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.limio.com/ai/chat-embed/setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
