# Installing the Hi, I'm Kai widget

This page covers the script tag, domain authorization, and single-page app placement needed to install the Hi, I'm Kai widget.

## How do I add the embed snippet?

The Hi, I'm Kai widget is a single `<script>` tag that you add to your site. It loads asynchronously and does not block page rendering.

Navigate to the Widget page and click **Copy install snippet**. Paste the generated code before the closing `</body>` tag on every page where you want the widget to appear.

```html
<script
  src="https://cdn.example.com/widget.js"
  data-site-id="YOUR_SITE_ID"
  async
></script>
```

The generated snippet includes the correct public widget identifier for your site. Keep the snippet unchanged unless the dashboard tells you to update it.

## How do allowed domains work?

By default, the widget only loads on domains you authorize. Add or edit allowed domains in **Widget -> Domains & features**.

Use comma-separated values for multiple domains, such as `example.com, staging.example.com`. Include any production, staging, or preview domains where you expect the widget to load.

## How do I install Hi, I'm Kai in a single-page app?

For single-page apps built with React, Next.js, Vue, or similar frameworks, include the snippet in your root HTML template. The widget detects route changes automatically.

For most apps, the correct location is the file that owns the final HTML shell, such as `index.html`, `_document.tsx`, or the root layout file.

## Related

- [Configure the widget](/docs/widget)
- [Crawl website content](/docs/crawl)
- [Review billing and plans](/docs/billing)

Source: https://www.hiimkai.ai/docs/install
