# Website SDK

The Alhena Website SDK lets you embed and customize the chat widget on your website. Use it to control widget behavior, respond to events, pass user data, and track e-commerce conversions.

## Quick Start

Add the following snippet to your website's HTML:

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

Your company key is found in your dashboard URL after `/dashboard/`.

{% hint style="info" %}
For EU region, use `https://eu.alhena.ai` for both the `apiBaseUrl` and the script src. See [JavaScript API](/docs/developer-reference/website-sdk/javascript-api.md) for full installation details.
{% endhint %}

## Reference

* [JavaScript API](/docs/developer-reference/website-sdk/javascript-api.md) - Methods for controlling the widget (open, close, send messages, etc.)
* [Events](/docs/developer-reference/website-sdk/events.md) - Subscribe to widget and conversation events
* [Styles API](/docs/developer-reference/website-sdk/styles-api.md) - Customize the widget's appearance
* [Custom Data](/docs/developer-reference/website-sdk/custom-data.md) - Pass user metadata for personalized AI interactions
* [A/B Testing](/docs/developer-reference/website-sdk/ab-testing.md) - Run experiments with different widget configurations

## E-commerce

* [Cart & Checkout Events](/docs/developer-reference/website-sdk/cart-checkout-events.md) - Track add-to-cart and purchase events
* [Revenue Attribution](/docs/developer-reference/website-sdk/cart-checkout-events/revenue-attribution.md) - Measure AI-driven conversions

## Examples

* [Code Examples](/docs/developer-reference/website-sdk/examples.md) - Ready-to-use integration patterns
* [Internationalization](/docs/developer-reference/website-sdk/examples/internationalization.md) - Multi-language support
* [Human Handoff Widget](/docs/developer-reference/website-sdk/examples/human-handoff-widget.md) - Integrate with external helpdesks
* [Scroll-Triggered Widget](/docs/developer-reference/website-sdk/examples/scroll-triggered-widget.md) - Show widget after user engagement


---

# Agent Instructions: 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:

```
GET https://alhena.gitbook.io/docs/developer-reference/website-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
