Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions assistant/widget.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

export const WidgetCodeBlock = ({ children, ...props }) => (
<CodeBlock {...props}>{children}</CodeBlock>
);

Check warning on line 13 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L13

Use semicolons judiciously.

The [assistant](/assistant) answers questions on your Mintlify site. To embed the same capability on another site or web app, use the widget. With the widget, you can give your users access to AI chat trained on your content in your product dashboard, marketing site, support portal, or elsewhere.

Expand Down Expand Up @@ -132,6 +132,35 @@

You can supply `supportEmail` and `starterQuestions` during initialization and change them later with `update()`. These values apply to the current embed and do not inherit from your Mintlify dashboard.

## Scope retrieval by language or version

Use `filter` to restrict what the assistant retrieves when your docs are organized by language or [versions](/organize/navigation#versions). Omit a field to search across every value for it.

Check warning on line 137 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L137

In general, use active voice instead of passive voice ('are organized').

```js
await window.MintlifyAssistant.init({
id: "YOUR_WIDGET_ID",
filter: {
language: "en",
version: "v2",
},
});
```

`language` must be a [supported language code](/organize/settings-reference#navigation-global-languages), such as `en`, `es`, `fr`, or `zh-Hans`. `version` matches the version name configured in your dashboard.

Change filters at runtime with `update()` when the visitor switches language or version in your application:

```js
await window.MintlifyAssistant.update({
filter: {
language: "fr",
version: null,
},
});
```

Pass `null` on a field to clear that filter, or `filter: null` to clear both.

## Configuration reference

### `AssistantConfig`
Expand All @@ -149,6 +178,7 @@
| `labels` | [`AssistantLabels`](#assistantlabels) | Customer-facing text overrides. |
| `supportEmail` | string | Sets the support address shown in the widget toolbar for this embed. |
| `starterQuestions` | string[] | Sets up to three empty-state prompts for this embed. |
| `filter` | [`AssistantFilter`](#assistantfilter) | Restricts retrieval to a docs language and version. |
| `hooks` | [`AssistantHooks`](#assistanthooks) | Event and error observers. |

### `AssistantAppearance`
Expand All @@ -168,6 +198,13 @@

Arbitrary CSS and neutral-palette overrides are not supported. The closed Shadow DOM protects both your application and the widget from cross-site style regressions.

### `AssistantFilter`

| Option | Type | Description |
| ---------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `language` | string or `null` | Restricts retrieval to a [supported language code](/organize/settings-reference#navigation-global-languages), such as `en`. Omit to search all languages. |
| `version` | string or `null` | Restricts retrieval to a docs version, such as `v2`. Omit to search all versions. |

### `AssistantLabels`

| Option | Values | Description |
Expand Down Expand Up @@ -225,6 +262,7 @@
| `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Deep-patches customer-facing text. |
| `supportEmail` | string or `null` | Changes the support address. Pass `null` to remove it. |
| `starterQuestions` | string[] or `null` | Changes up to three prompts. Pass `null` to restore an empty list. |
| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Deep-patches retrieval filters. Pass `null` to clear all filters. |
| `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Deep-patches event and error observers. |

## Browser API
Expand All @@ -241,7 +279,7 @@

Conversation snapshots remain private to the widget. Each method resolves to `void`.

## Content Security Policy

Check warning on line 282 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L282

'Content Security Policy' should use sentence-style capitalization.

If your site uses a Content Security Policy, allow the origins required by your enabled widget features:

Expand All @@ -251,9 +289,9 @@
| `connect-src` | `https://api.mintlify.com` | Widget API |
| `style-src` | `https://cdn.jsdelivr.net` | Widget style sheet |
| `font-src` | `https://cdn.jsdelivr.net` | Optional bundled Inter font |
| `script-src`, `connect-src`, and `frame-src` | `https://challenges.cloudflare.com` | Turnstile bot protection |

Check warning on line 292 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L292

Use 'Cloudflare' instead of 'cloudflare'.
| `script-src` | `https://js.hcaptcha.com` | hCaptcha bot protection |

Check warning on line 293 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L293

Use 'hCaptcha' instead of 'hcaptcha'.
| `connect-src` and `frame-src` | `https://*.hcaptcha.com` | hCaptcha bot protection |

Check warning on line 294 in assistant/widget.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

assistant/widget.mdx#L294

Use 'hCaptcha' instead of 'hcaptcha'.

A strict `script-src` policy must still authorize both the loader and initialization script. Passing `nonce` to `init()` propagates it only to resources the widget creates after initialization.

Expand Down
42 changes: 42 additions & 0 deletions es/assistant/widget.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,37 @@ Cambiar `identity` inicia una nueva conversación. Cambiar el ID del widget o el

Puedes proporcionar `supportEmail` y `starterQuestions` durante la inicialización y cambiarlos más tarde con `update()`. Estos valores se aplican al embed actual y no se heredan desde tu panel de Mintlify.

<div id="scope-retrieval-by-language-or-version">
## Delimitar la recuperación por idioma o versión
</div>

Usa `filter` para restringir lo que el asistente recupera cuando tu documentación está organizada por idioma o [versiones](/es/organize/navigation#versions). Omite un campo para buscar en todos sus valores.

```js
await window.MintlifyAssistant.init({
id: "YOUR_WIDGET_ID",
filter: {
language: "en",
version: "v2",
},
});
```

`language` debe ser un [código de idioma admitido](/es/organize/settings-reference#navigation-global-languages), como `en`, `es`, `fr` o `zh-Hans`. `version` coincide con el nombre de la versión configurada en tu panel.

Cambia los filtros en tiempo de ejecución con `update()` cuando el visitante cambie de idioma o versión en tu aplicación:

```js
await window.MintlifyAssistant.update({
filter: {
language: "fr",
version: null,
},
});
```

Pasa `null` en un campo para borrar ese filtro, o `filter: null` para borrar ambos.

<div id="configuration-reference">
## Referencia de configuración
</div>
Expand All @@ -165,6 +196,7 @@ Pasa este objeto a `init()`.
| `labels` | [`AssistantLabels`](#assistantlabels) | Sobrescrituras de texto orientado al cliente. |
| `supportEmail` | string | Establece la dirección de soporte que se muestra en la barra de herramientas del widget para este embed. |
| `starterQuestions` | string[] | Establece hasta **tres** sugerencias de estado vacío para este embed. |
| `filter` | [`AssistantFilter`](#assistantfilter) | Restringe la recuperación a un idioma y versión de la documentación. |
| `hooks` | [`AssistantHooks`](#assistanthooks) | Observadores de eventos y errores. |

<div id="assistantappearance">
Expand All @@ -186,6 +218,15 @@ Pasa este objeto a `init()`.

No se admiten sobrescrituras arbitrarias de CSS ni de paleta neutra. El Shadow DOM cerrado protege tanto a tu aplicación como al widget de regresiones de estilos entre sitios.

<div id="assistantfilter">
### `AssistantFilter`
</div>

| Option | Type | Description |
| ---------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `language` | string or `null` | Restringe la recuperación a un [código de idioma admitido](/es/organize/settings-reference#navigation-global-languages), como `en`. Omítelo para buscar en todos los idiomas. |
| `version` | string or `null` | Restringe la recuperación a una versión de la documentación, como `v2`. Omítela para buscar en todas las versiones. |

<div id="assistantlabels">
### `AssistantLabels`
</div>
Expand Down Expand Up @@ -253,6 +294,7 @@ Pasa este objeto a `update()`. Todos los campos son opcionales y `null` restaura
| `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Aplica parches en profundidad al texto orientado al cliente. |
| `supportEmail` | string or `null` | Cambia la dirección de soporte. Pasa `null` para eliminarla. |
| `starterQuestions` | string[] or `null` | Cambia hasta tres sugerencias. Pasa `null` para restaurar una lista vacía. |
| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Aplica parches en profundidad a los filtros de recuperación. Pasa `null` para borrar todos los filtros. |
| `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Aplica parches en profundidad a los observadores de eventos y errores. |

<div id="browser-api">
Expand Down
42 changes: 42 additions & 0 deletions fr/assistant/widget.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,37 @@ La modification de `identity` démarre une nouvelle conversation. La modificatio

Vous pouvez fournir `supportEmail` et `starterQuestions` lors de l'initialisation et les modifier ultérieurement avec `update()`. Ces valeurs s'appliquent à l'intégration en cours et ne sont pas héritées de votre tableau de bord Mintlify.

<div id="scope-retrieval-by-language-or-version">
## Restreindre la recherche par langue ou version
</div>

Utilisez `filter` pour restreindre ce que l'assistant récupère lorsque votre documentation est organisée par langue ou par [versions](/fr/organize/navigation#versions). Omettez un champ pour rechercher dans toutes ses valeurs.

```js
await window.MintlifyAssistant.init({
id: "YOUR_WIDGET_ID",
filter: {
language: "en",
version: "v2",
},
});
```

`language` doit être un [code de langue pris en charge](/fr/organize/settings-reference#navigation-global-languages), tel que `en`, `es`, `fr` ou `zh-Hans`. `version` correspond au nom de la version configurée dans votre tableau de bord.

Modifiez les filtres au moment de l'exécution avec `update()` lorsque le visiteur change de langue ou de version dans votre application :

```js
await window.MintlifyAssistant.update({
filter: {
language: "fr",
version: null,
},
});
```

Passez `null` sur un champ pour effacer ce filtre, ou `filter: null` pour effacer les deux.

<div id="configuration-reference">
## Référence de configuration
</div>
Expand All @@ -165,6 +196,7 @@ Passez cet objet à `init()`.
| `labels` | [`AssistantLabels`](#assistantlabels) | Substitutions du texte visible par le client. |
| `supportEmail` | string | Définit l'adresse d'assistance affichée dans la barre d'outils du widget pour cette intégration. |
| `starterQuestions` | string[] | Définit jusqu'à **trois** invites d'état vide pour cette intégration. |
| `filter` | [`AssistantFilter`](#assistantfilter) | Restreint la recherche à une langue et à une version de la documentation. |
| `hooks` | [`AssistantHooks`](#assistanthooks) | Observateurs d'événements et d'erreurs. |

<div id="assistantappearance">
Expand All @@ -186,6 +218,15 @@ Passez cet objet à `init()`.

Les substitutions CSS arbitraires et les palettes neutres ne sont pas prises en charge. Le Shadow DOM fermé protège à la fois votre application et le widget des régressions de style entre sites.

<div id="assistantfilter">
### `AssistantFilter`
</div>

| Option | Type | Description |
| ---------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `language` | string or `null` | Restreint la recherche à un [code de langue pris en charge](/fr/organize/settings-reference#navigation-global-languages), tel que `en`. Omettez pour rechercher dans toutes les langues. |
| `version` | string or `null` | Restreint la recherche à une version de la documentation, telle que `v2`. Omettez pour rechercher dans toutes les versions. |

<div id="assistantlabels">
### `AssistantLabels`
</div>
Expand Down Expand Up @@ -253,6 +294,7 @@ Passez cet objet à `update()`. Chaque champ est facultatif, et `null` restaure
| `labels` | [`AssistantLabels`](#assistantlabels) or `null` | Applique un patch profond au texte visible par le client. |
| `supportEmail` | string or `null` | Change l'adresse d'assistance. Passez `null` pour la supprimer. |
| `starterQuestions` | string[] or `null` | Change jusqu'à trois invites. Passez `null` pour restaurer une liste vide. |
| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | Applique un patch en profondeur aux filtres de recherche. Passez `null` pour effacer tous les filtres. |
| `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | Applique un patch profond aux observateurs d'événements et d'erreurs. |

<div id="browser-api">
Expand Down
42 changes: 42 additions & 0 deletions zh/assistant/widget.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,37 @@ await window.MintlifyAssistant.update({

你可以在初始化时提供 `supportEmail` 和 `starterQuestions`,也可以稍后通过 `update()` 更改。这些值仅作用于当前嵌入,不会继承自你的 Mintlify 仪表板。

<div id="scope-retrieval-by-language-or-version">
## 按语言或版本限定检索范围
</div>

当你的文档按语言或[版本](/zh/organize/navigation#versions)组织时,使用 `filter` 来限定助手检索的范围。省略某个字段即可对该字段的所有取值进行检索。

```js
await window.MintlifyAssistant.init({
id: "YOUR_WIDGET_ID",
filter: {
language: "en",
version: "v2",
},
});
```

`language` 必须是[受支持的语言代码](/zh/organize/settings-reference#navigation-global-languages),例如 `en`、`es`、`fr` 或 `zh-Hans`。`version` 与你在仪表板中配置的版本名称一致。

当访客在你的应用中切换语言或版本时,可通过 `update()` 在运行时更改筛选条件:

```js
await window.MintlifyAssistant.update({
filter: {
language: "fr",
version: null,
},
});
```

对某个字段传入 `null` 可清除该筛选条件,传入 `filter: null` 可同时清除两个筛选条件。

<div id="configuration-reference">
## 配置参考
</div>
Expand All @@ -165,6 +196,7 @@ await window.MintlifyAssistant.update({
| `labels` | [`AssistantLabels`](#assistantlabels) | 面向客户的文案覆盖设置。 |
| `supportEmail` | string | 设置该嵌入在小组件工具栏中显示的支持邮箱。 |
| `starterQuestions` | string[] | 为该嵌入设置最多 **三** 条空状态提示。 |
| `filter` | [`AssistantFilter`](#assistantfilter) | 将检索限定到指定的文档语言和版本。 |
| `hooks` | [`AssistantHooks`](#assistanthooks) | 事件和错误观察者。 |

<div id="assistantappearance">
Expand All @@ -186,6 +218,15 @@ await window.MintlifyAssistant.update({

不支持任意 CSS 和中性色板覆盖。封闭的 Shadow DOM 可同时保护你的应用与小组件,防止跨站样式回归。

<div id="assistantfilter">
### `AssistantFilter`
</div>

| Option | Type | Description |
| ---------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `language` | string or `null` | 将检索限定到[受支持的语言代码](/zh/organize/settings-reference#navigation-global-languages),例如 `en`。省略以在所有语言中检索。 |
| `version` | string or `null` | 将检索限定到指定的文档版本,例如 `v2`。省略以在所有版本中检索。 |

<div id="assistantlabels">
### `AssistantLabels`
</div>
Expand Down Expand Up @@ -253,6 +294,7 @@ hooks: {
| `labels` | [`AssistantLabels`](#assistantlabels) or `null` | 深度合并面向客户的文案。 |
| `supportEmail` | string or `null` | 更改支持邮箱。传入 `null` 可移除。 |
| `starterQuestions` | string[] or `null` | 更改最多三条提示。传入 `null` 可恢复为空列表。 |
| `filter` | [`AssistantFilter`](#assistantfilter) or `null` | 深度合并检索筛选条件。传入 `null` 可清除所有筛选条件。 |
| `hooks` | [`AssistantHooks`](#assistanthooks) or `null` | 深度合并事件和错误观察者。 |

<div id="browser-api">
Expand Down