mirror of
https://github.com/mintlify/docs.git
synced 2026-09-14 13:35:46 +08:00
017d7c7377
* fix: reduce Vale false positives via vocab and config updates - Make English-word vocab entries case-insensitive so sentence-start capitalization and normal prose usage stop flagging (agents, rest, cursor, setup, endpoints, etc.) - Add vocab entries for filenames and code identifiers that appear in frontmatter and JSX contexts (docs.json, llms.txt, CLAUDE.md, etc.) - Ignore openapi frontmatter lines, filenames, JSX attributes, email addresses, and internal link targets via TokenIgnores - Skip inline code scope and indented code fences - Add Headings exceptions for proper nouns (Claude Code, GitHub Actions, Route 53, GA4, etc.) - Disable linting for the all-code vercel-json-generator snippet Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: resolve all Vale warnings and errors across docs Content fixes: - Reword sentences using 'will', first person, spaced em dashes, 'e.g.', Latin abbreviations, and hyphenated adverbs - Sentence-case headings that started with dotted filenames - Backtick literal API values instead of bolding them - Move periods inside quotation marks - Fix Oxford comma rule misfires by restructuring sentences False-positive suppression: - Vale toggles around example user questions, keyboard shortcut keys (Cmd+I), UI labels, and code samples in JSX contexts that Vale misparses - Exclude vale toggle comments from the brace Token/BlockIgnores so in-document commands actually reach Vale (the greedy brace pattern was also silently swallowing large regions; now lazy) - Vocab entries for code identifiers (internal_id, handleSubmit, etc.) - Per-file rule disables for component docs with dotted JSX names and files where link-target linting ignores in-document toggles Result: vale --minAlertLevel warning is clean repo-wide; only suggestion-level items (Passive, Semicolons, Acronyms) remain. mint broken-links passes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: correct WordList rule instead of degrading prose - Restore sentence-start "Email" in advanced-support; the rule now only flags hyphenated e-mail/E-mail forms - Restore the idiom "above all else"; the above->preceding swap now exempts "above all" Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: restore deliberate prose flagged by blunt rules - Restore spatial 'above the navbar' / 'above a page title' in custom-scripts; the above->preceding swap now exempts 'above the/a/an' - Restore the '= ...' in the react-components named-export example (the ellipsis is inside inline code) with an Ellipses toggle - Restore SLA phrasing 'will use commercially reasonable efforts' with a Will toggle - Restore the quoted developer question in the GEO guide intro with a FirstPerson toggle, matching the file's other example questions Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: remove WordList swaps that flag legitimate English - Drop tablet->device and firewalls->firewall rules; both words are correct in ordinary prose - Narrow touch->tap to UI-instruction phrasing (touch the/a) so 'keep in touch' and 'touch devices' stop flagging Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: reposition vale toggles to wrap whole blocks Toggle comments placed between list items split the lists (restarting ol numbering in deployments) and comments flush against tables risked breaking GFM table parsing. Wrap entire lists/tables with blank-line separation instead. Verified rendering with mint dev: single ol with two items, tables intact, no comments in visible DOM. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor: prune accept.txt to load-bearing entries Empirically removed 166 vocab entries (575 -> 409) whose removal causes no Vale flags across all 908 English pages: dictionary words that never needed listing (agents, setup, endpoints, webhooks, yaml), lowercase entries the speller already accepts, and filename entries made redundant by inline vale toggles. Kept every case-enforcing entry (API, JSON, GitHub, ...) so casing policy is unchanged, plus entries that double as capitalization exceptions for headings (mcp, md, auth, cursor, txt). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Update ai/mintlify-mcp.mdx * Update api/agent/v2/create-agent-job.mdx * chore: alphabetize Headings exceptions and accept.txt Case-insensitive sort, ignoring the (?i) prefix; also drops a duplicate Scala entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix: re-apply OxfordComma rewrite lost in branch merge Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: resolve Vale suggestions batch 1 (acronyms, semicolons, passive voice) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * docs: resolve remaining Vale suggestions (passive voice batch 2) Rewrite ~90 passive constructions to active voice across deploy, guides, migration-services, and organize docs. Toggle the deliberate passive examples in the style-and-tone guide ('by zombies' test). Add axios/lodash vocab entries for a repositioned code example. vale . is now fully clean: 0 errors, 0 warnings, 0 suggestions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
217 lines
6.1 KiB
Plaintext
217 lines
6.1 KiB
Plaintext
---
|
|
title: "Personalized content"
|
|
description: "Show personalized content based on user authentication data, group memberships, and custom variables to tailor documentation per audience."
|
|
keywords: ["content personalization", "personalization", "user data", "groups", "dynamic", "prefill"]
|
|
---
|
|
|
|
<Note>
|
|
Personalization requires [authentication](/deploy/authentication-setup) configured with OAuth or JWT.
|
|
</Note>
|
|
|
|
Customize content for your users when they log in to your documentation site. You can prefill API keys, show content specific to a user's plan or role, and filter API reference content based on group membership.
|
|
|
|
## API key prefilling
|
|
|
|
Automatically populate API playground fields with user-specific values by returning matching field names in your user data. Include the values in the `apiPlaygroundInputs` field of your [user data](/deploy/authentication-setup#user-data-format).
|
|
|
|
```json
|
|
{
|
|
"apiPlaygroundInputs": {
|
|
"header": { "X-API-Key": "user_api_key_123" },
|
|
"server": { "subdomain": "acme" }
|
|
}
|
|
}
|
|
```
|
|
|
|
The field names must match the names defined in your OpenAPI specification. Mintlify applies only values that match the current endpoint's security scheme.
|
|
|
|
## Dynamic MDX content
|
|
|
|
Display content based on user information like name, plan, or organization with the `user` variable in your MDX pages. Include custom data in the `content` field of your [user data](/deploy/authentication-setup#user-data-format).
|
|
|
|
```json
|
|
{
|
|
"content": {
|
|
"firstName": "Jane",
|
|
"company": "Acme Corp",
|
|
"plan": "Enterprise"
|
|
}
|
|
}
|
|
```
|
|
|
|
Reference these values in your MDX.
|
|
|
|
```mdx
|
|
Welcome back, {user.firstName}! Your {user.plan} plan includes 100 seats for members in your {user.company} organization.
|
|
```
|
|
|
|
For conditional rendering based on user data, use the `user` variable in JSX components.
|
|
|
|
```jsx
|
|
{
|
|
user.plan === 'enterprise'
|
|
? <>Contact your admin to enable this feature.</>
|
|
: <>See <a href="https://yoursite.com/pricing">pricing</a> for information about upgrading.</>
|
|
}
|
|
```
|
|
|
|
<Note>
|
|
The `user` variable is an empty object for logged-out users. Use optional chaining on all `user` fields to prevent errors. For example, `{user.org?.plan}` instead of `{user.org.plan}`.
|
|
</Note>
|
|
|
|
## Page visibility
|
|
|
|
Restrict pages to specific user groups by adding `groups` to page frontmatter. Users must belong to at least one listed group to access the page.
|
|
|
|
```mdx
|
|
---
|
|
title: "Admin settings"
|
|
groups: ["admin"]
|
|
---
|
|
```
|
|
|
|
For more details on how groups interact with public pages, see [Control access with groups](/deploy/authentication-setup#control-access-with-groups).
|
|
|
|
## OpenAPI content filtering
|
|
|
|
Filter API reference content based on user groups with the `x-mint` extension in your OpenAPI specification. You can filter entire endpoints, individual schema properties, `oneOf` variants, and enum values.
|
|
|
|
### Filter endpoints
|
|
|
|
Add `x-mint.groups` to an operation or path to restrict the endpoint page to specific user groups. Users not in the listed groups won't see the endpoint in navigation or be able to access its page.
|
|
|
|
<CodeGroup>
|
|
|
|
```json {6-8} Restricted operation
|
|
{
|
|
"paths": {
|
|
"/billing": {
|
|
"get": {
|
|
"summary": "Get billing details",
|
|
"x-mint": {
|
|
"groups": ["admin", "billing"]
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Billing details"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
```json {3-5} Restricted path
|
|
{
|
|
"paths": {
|
|
"x-mint": {
|
|
"groups": ["admin", "billing"]
|
|
},
|
|
"/billing": {
|
|
"get": {
|
|
"summary": "Get billing details",
|
|
}
|
|
},
|
|
"/users": {
|
|
"get": {
|
|
"summary": "Get user details",
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</CodeGroup>
|
|
|
|
### Filter schema properties
|
|
|
|
Add `x-mint.groups` to individual properties within request bodies, parameters, or responses. Properties without `x-mint.groups` remain visible to all users.
|
|
|
|
```json {11-13} Restricted property
|
|
{
|
|
"components": {
|
|
"schemas": {
|
|
"User": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"internal_id": {
|
|
"type": "string",
|
|
"x-mint": {
|
|
"groups": ["admin"]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|
|
|
|
In this example, all users see the `name` property. Only users in the `admin` group see the `internal_id` property.
|
|
|
|
### Filter oneOf variants
|
|
|
|
Add `x-mint.groups` to individual `oneOf` options to restrict which schema variants a user can see.
|
|
|
|
```json {7-9} Restricted oneOf variant
|
|
{
|
|
"schema": {
|
|
"oneOf": [
|
|
{
|
|
"title": "Enterprise config",
|
|
"type": "object",
|
|
"x-mint": {
|
|
"groups": ["enterprise"]
|
|
},
|
|
"properties": {
|
|
"sso_enabled": { "type": "boolean" }
|
|
}
|
|
},
|
|
{
|
|
"title": "Standard config",
|
|
"type": "object",
|
|
"properties": {
|
|
"notifications": { "type": "boolean" }
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
```
|
|
|
|
### Filter enum values
|
|
|
|
Use the `x-mint-enum` extension to restrict individual enum values by group. List each restricted value as a key, with its allowed groups as the value. Enum values not listed in `x-mint-enum` are visible to all users.
|
|
|
|
```json {4-7} Restricted enum values
|
|
{
|
|
"type": "string",
|
|
"enum": ["free", "pro", "enterprise"],
|
|
"x-mint-enum": {
|
|
"pro": ["pro", "enterprise"],
|
|
"enterprise": ["enterprise"]
|
|
}
|
|
}
|
|
```
|
|
|
|
In this example, all users see `free`. Users in the `pro` or `enterprise` groups see `pro`. Only users in the `enterprise` group see `enterprise`.
|
|
|
|
<Note>
|
|
`x-mint-enum` is a separate top-level extension on the schema object, not nested under `x-mint`.
|
|
</Note>
|
|
|
|
## User data format
|
|
|
|
Your authentication system returns user data that controls personalization. The `groups`, `content`, and `apiPlaygroundInputs` fields described on this page are all part of the user data object.
|
|
|
|
For the full user data format and field reference, see [User data format](/deploy/authentication-setup#user-data-format).
|
|
|
|
## Logout behavior
|
|
|
|
Logout occurs on the client side. When users click the logout button, Mintlify clears their stored session data in the browser.
|
|
|
|
To limit how long personalization data persists, set the `expiresAt` field in your user data.
|