Embed the assistant

You can embed the Ask AI launcher outside your docs site so users can ask docs 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.

Basic embed

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

<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.

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

Common options:

AttributePurpose
data-sideShow the launcher on the left or right side
data-modeUse light, dark, or system color mode
data-exclude-pathsHide the assistant on matching routes
data-z-indexAdjust 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:

<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:

/checkout/admin/*/billing/*

When to embed

Embed Ask AI 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.