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

# Custom built

> Add the Lark AI agent to your custom-built website easily.

If your site is built with a custom framework or hand-coded HTML, adding Lark is a single script tag. It works with any stack.

## Before you start

* Your Lark agent is live and your organisation domain is saved in Organisation settings.
* You have access to edit your site's HTML or template files.

## Get your embed script

In your Lark dashboard open **Add to site** and copy the floating button script.

## Floating button

Paste the script before the closing `</body>` tag in your base layout or template file. This adds the agent to every page.

```html theme={null}
<script src="https://YOUR-LARK-DOMAIN/embed.js" data-key="YOUR_KEY" defer></script>
```

## Inline embed

To render the agent inside a specific element on a page, add a container div and use the inline embed code:

```html theme={null}
<div id="lark"></div>
<script src="https://YOUR-LARK-DOMAIN/embed.js" data-key="YOUR_KEY" data-mode="inline" data-target="#lark" data-height="600" defer></script>
```

## Open from your own button

With the floating script on the page, any element with the `data-estimator-open` attribute opens the agent. Add `data-launcher="false"` to the script tag to hide the default button.

```html theme={null}
<a href="#" data-estimator-open>Talk to our agent</a>
```

You can also trigger it from JavaScript:

```js theme={null}
window.Estimator.open()
```

<Warning>
  Your website's domain must match the domain saved in **Organisation Settings** in Lark before the agent will load. Go to Organisation Settings, check the domain field, and make sure it matches your live site. The agent will not appear on localhost or staging URLs unless those domains are added separately.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.