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

# @concatflow/embed

> The browser library. It loads the hosted widget.js and gives you a typed Concatflow object.

```bash theme={"system"}
npm install @concatflow/embed
```

```ts theme={"system"}
import { loadConcatflow } from "@concatflow/embed";

const Concatflow = await loadConcatflow();
Concatflow.init({ siteToken: "st_YOUR_SITE_TOKEN", launcher: "bubble" });
```

Like `@stripe/stripe-js`, the package does not contain the assistant. It loads `widget.js` from Concatflow once, so your customers always get the current version. What it adds: types, validated options, and a React component.

> [!TIP]
>
> No build step? You do not need this package. Paste the two tags from **Doors**. See [Quickstart](https://docs.concatflow.com/quickstart.md).

## Reference

> **[loadConcatflow()](https://docs.concatflow.com/reference/embed/load-concatflow.md)**
>
> Load `widget.js` once and get the `Concatflow` object.

> **[Concatflow.init()](https://docs.concatflow.com/reference/embed/init.md)**
>
> Open the assistant: door, launcher, theme, renewal.

> **[Assistant instance](https://docs.concatflow.com/reference/embed/instance.md)**
>
> `setSession`, `open`, `close`, `destroy`.

> **[\<ConcatflowAssistant>](https://docs.concatflow.com/reference/embed/react.md)**
>
> The React component, from `@concatflow/embed/react`. React 18 or later.

> **[\<concatflow-assistant>](https://docs.concatflow.com/reference/embed/element.md)**
>
> The HTML element, for pages without JavaScript of your own.

## Guides

* [Per-user door](https://docs.concatflow.com/guides/per-user-door.md): open a session on your server, show the assistant.
* [React](https://docs.concatflow.com/guides/react.md): the component in a React or Next.js app.
* [Bar or bubble](https://docs.concatflow.com/guides/bar-or-bubble.md) and [Appearance](https://docs.concatflow.com/guides/appearance.md).


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