> For the complete documentation index, see [llms.txt](https://alhena.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alhena.gitbook.io/docs/features/chat-widget/installation.md).

# Installation

Add the Alhena chat widget to your website with a simple JavaScript snippet.

<figure><img src="/files/rkPgz6i56JgLranEGydc" alt="" width="375"><figcaption><p>Example Alhena AI Widget</p></figcaption></figure>

## Quick Start

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

```html
<script>
document.gleenConfig = {
    company: 'YOUR_COMPANY_KEY',
    apiBaseUrl: 'https://app.alhena.ai'
};
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>
```

{% hint style="info" %}
Replace `YOUR_COMPANY_KEY` with your company key. Find it in your dashboard URL: if your dashboard is `https://app.alhena.ai/dashboard/acme/` then your company key is `acme`.
{% endhint %}

## Finding Your Snippet

You can also copy your pre-configured snippet from the Alhena dashboard:

**Integrations > Website > Installation**

## Regional URLs

Use the API base URL for your region:

| Region | API Base URL            |
| ------ | ----------------------- |
| US     | `https://app.alhena.ai` |
| EU     | `https://eu.alhena.ai`  |

Example for EU region:

```html
<script>
document.gleenConfig = {
    company: 'YOUR_COMPANY_KEY',
    apiBaseUrl: 'https://eu.alhena.ai'
};
</script>
<script src="https://eu.alhena.ai/sdk/gleenWidget.js"></script>
```

## Previewing Before Going Live

While the widget is installed but not yet enabled (or hidden by an [A/B visibility experiment](/docs/developer-reference/website-sdk/ab-testing.md)), you can still force it to appear for QA by adding the `alhena_test=true` query parameter to any page URL:

```
https://www.yoursite.com/any-page?alhena_test=true
```

This temporarily force-enables both the chat widget (floating and inline) and the [Product FAQ widget](/docs/features/product-faqs.md) on that page load, overriding the backend enabled flag and any experiment that would otherwise hide it.

{% hint style="info" %}
`alhena_test=true` only affects the page load where it's present in the URL — it's a preview tool for your own QA, not a way to enable the widget for visitors. Remove it (or just navigate without it) to return to normal behavior.
{% endhint %}

## Next Steps

Once installed, you can:

* [Customize the widget appearance](/docs/features/chat-widget/customization.md) in the dashboard
* Set up [icebreakers](/docs/features/chat-widget/icebreakers.md) and [nudges](/docs/features/chat-widget/nudges.md)
* Configure [human handoff](/docs/features/chat-widget/human-handoff.md)

## Developer Reference

For programmatic control and advanced integrations, see the [SDK documentation](/docs/developer-reference/website-sdk.md):

* [JavaScript API](/docs/developer-reference/website-sdk/javascript-api.md) - Control widget programmatically (open, close, toggle, send messages)
* [Events](/docs/developer-reference/website-sdk/events.md) - Listen for widget events
* [Styles API](/docs/developer-reference/website-sdk/styles-api.md) - Customize appearance via code
* [Code Examples](/docs/developer-reference/website-sdk/examples.md) - Common integration patterns
