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

# Embed script

> Add the Bookster chat widget to your website with a single script tag

## Basic setup

Add the following script tag to your website, just before the closing `</body>` tag:

```html theme={null}
<script src="https://YOUR_BOOKSTER_URL/widget.js?customer=YOUR_CUSTOMER_SLUG"></script>
```

The widget will automatically:

* Validate that your domain is in the allowed domains list
* Generate a secure session token
* Render the chat button in the bottom-right corner of the page

<Frame>
  <img src="https://mintcdn.com/bookster/Nb50qcSA-sBJgluL/images/screenshots/widget-open.png?fit=max&auto=format&n=Nb50qcSA-sBJgluL&q=85&s=3dd0d86d07a7ca54eb9ba307f752b8f4" alt="Chat widget open showing the welcome message and conversation area" width="400" height="700" data-path="images/screenshots/widget-open.png" />
</Frame>

## Parameters

| Parameter  | Required | Description                                                     |
| ---------- | -------- | --------------------------------------------------------------- |
| `customer` | Yes      | Your account slug, found in **Settings** in the admin dashboard |

## How it works

When the script loads, it:

1. Checks the current page's domain against your [allowed domains list](/widget/domain-allowlist)
2. If allowed, generates a signed token valid for 24 hours
3. Creates an iframe containing the chat widget
4. Renders a floating chat button on your page

The widget runs inside an iframe for security isolation — it cannot access your page's DOM or cookies, and your page cannot access the widget's internal state.

## URL parameters

You can control the widget via URL query parameters on your page:

```
https://yoursite.com?chat=open&message=I'd+like+to+book+a+haircut
```

| Parameter      | Description                                        |
| -------------- | -------------------------------------------------- |
| `chat=open`    | Automatically opens the widget when the page loads |
| `message=TEXT` | Sends an initial message to the booking assistant  |

This is useful for linking directly to the chat from emails, ads, or other pages.

## Multiple pages

The script is safe to include on every page of your site. The widget maintains its state across page navigations within the same session.
