---
title: Embed the assistant
description: Add the Knowledge Assistant launcher to another website or app.
---

You can embed the Knowledge Assistant launcher outside your docs site so users
can ask questions from another website or product surface.

The embedded assistant uses the same published docs context, API reference
context, web page sources, and custom notes as the assistant on your docs site.

<Callout type="info" title="Use the docs site as the source">
Load the embed script from the published docs site whose assistant you want to
use.
</Callout>

## Basic embed

Add the embed script to the page where the assistant should appear:

```html
<script
  src="https://docs.example.com/-/assistant/embed.js"
  defer
></script>
```

Replace `https://docs.example.com` with your published docs domain.

## Configure with data attributes

Use data attributes when the embedding page needs a small override.

```html
<script
  src="https://docs.example.com/-/assistant/embed.js"
  data-side="right"
  data-mode="system"
  data-exclude-paths="/checkout/*,/admin/*"
  defer
></script>
```

Common options:

| Attribute | Purpose |
| --- | --- |
| `data-side` | Show the launcher on the `left` or `right` side |
| `data-mode` | Use `light`, `dark`, or `system` color mode |
| `data-exclude-paths` | Hide the assistant on matching routes |
| `data-z-index` | Adjust stacking when the host app has high overlays |

## Configure globally

Set `window.AssistantEmbedConfig` before loading the script when you want to
configure shared values from JavaScript:

```html
<script>
  window.AssistantEmbedConfig = {
    mode: "system",
    excludePaths: ["/checkout/*", "/admin/*"]
  };
</script>
<script
  src="https://docs.example.com/-/assistant/embed.js"
  defer
></script>
```

## Route exclusions

Use route exclusions for pages where an assistant launcher would interrupt the
experience, such as checkout, account setup, or admin-only flows.

Patterns can target one route, a route subtree, or a wildcard pattern:

```txt
/checkout
/admin/*
/billing/*
```

## When to embed

Embed the assistant when users need documentation answers while they are using
another surface, such as a product dashboard, onboarding flow, or support
portal.

Do not embed the assistant in places where users expect account-specific support
or private data lookup unless your docs context clearly explains what the
assistant can and cannot answer.

## Related pages

<Columns columns={2}>
  <Column>

  <Card title="Knowledge Assistant overview" href="/knowledge-assistant/overview" icon="lucide:message-circle-question-mark">
    Understand the assistant.
  </Card>

  </Column>
  <Column>

  <Card title="Customize the assistant" href="/knowledge-assistant/customize-assistant" icon="lucide:sliders-horizontal">
    Configure the docs widget.
  </Card>

  </Column>
</Columns>
