# Custom CSS
Fully customize your documentation with custom CSS
Custom CSS is available as an add-on to the [Pro plan](https://mintlify.com/pricing).
Add any number of CSS files to your repository and the defined class names will be applied and available across all of your MDX files.
## Adding style.css
For example, you can add the following `style.css` file to customize the styling of the navbar and footer.
```css
#navbar {
background: "#fffff2";
padding: 1rem;
}
footer {
margin-top: 2rem;
}
```
## Using Identifiers
Mintlify has a set of common identifiers to help you tag important elements of the UI. Some, but not all are listed in the following:
`#topbar-cta-button` `#navbar` `#sidebar` `#content-area` `#table-of-contents`
Use inspect element to find references to elements you're looking to
customize.
References and the styling of common elements are subject to change as the
platform evolves. Please use custom styling with caution.
# Custom JS
Add JavaScript functionality globally
Custom JS is available as an add-on to the [Pro plan](https://mintlify.com/pricing).
Custom JS allows you to add custom executable code globally. It is the equivalent of adding a `
```
To use the widget in React and Next.js apps, use the React component from the `@mintlify/widget-react` [package](https://www.npmjs.com/package/@mintlify/widget-react). Here is a basic example of how to use the component in your React application:
```jsx
```
## Usage
In the first script tag or the React component props, you can customize the appearance and other settings of the widget. `mintlifyWidgetSettings` accepts the following props:
| Prop | Type | Description |
| ------------ | ------------------------------------------------------------------- | ---------------------------------------------------------- |
| `connection` | [MintlifyWidgetConnectionProps](#mintlifywidgetconnectionProps) | Information needed to connect to our API. Required. |
| `display?` | [MintlifyWidgetDisplayProps](#mintlifywidgetdisplayProps) | Configurations for the widget appearance and interactions. |
| `tracking?` | [MintlifyWidgetTrackingFunctions](#mintlifywidgettrackingfunctions) | Callback functions for tracking analytics. |
### MintlifyWidgetConnectionProps
| Prop | Type | Description |
| -------- | -------- | ----------------------------------------------------------- |
| `apiKey` | `string` | Widget API key generated from Mintlify dashboard. Required. |
| `url?` | `string` | Used for internal testing only |
### MintlifyWidgetDisplayProps
| Prop | Type | Description |
| ------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------- |
| `trigger?` | [MintlifyWidgetDisplayTriggerProps](#mintlifywidgetdisplaytriggerprops) | Appearance of the trigger. |
| `colors?` | [MintlifyWidgetDisplayColorsProps](#mintlifywidgetdisplaycolorsprops) | Colors used across the widget. |
| `chat?` | [MintlifyWidgetDisplayChatProps](#mintlifywidgetdisplaychatprops) | Configs specific to AI chat. |
| `isDarkMode?` | `boolean` | Controlled dark mode appearance. Defaults to OS preference. |
#### MintlifyWidgetDisplayTriggerProps
| Prop | Type | Description |
| ------------- | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| `type?` | `'button'`\|`'input'` | Type of the trigger to display. Defaults to `button`. |
| `label?` | `string` | Label displayed in the trigger. Defaults to `Get help` for the button trigger and `Ask anything...` for the input trigger. |
| `buttonIcon?` | `'chat'`\|`'sparkles'`\|`'mintlify'` | Icon used in the trigger. Only available for the `button` trigger. Defaults to `chat`. |
| `iconOnly?` | `boolean` | Only show icon in the trigger or not. Defaults to `false`. |
Here is an overview of what the trigger looks like with different configurations.
| `type='input'` | |
| -------------- | ---------------------------------------------------------------------------------------- |
| | |
| `type='button'` | `'chat'` | `'sparkles'` | `'mintlify'` |
| ---------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `iconOnly=false` | | | |
| `iconOnly=true` | | | |
#### MintlifyWidgetDisplayColorsProps
| Prop | Type | Description |
| --------------- | -------- | -------------------------------------------------------- |
| `primary?` | `string` | Primary color used in the widget. Defaults to `#0D9373`. |
| `primaryLight?` | `string` | Primary color in dark mode. Defaults to `#55D799`. |
#### MintlifyWidgetDisplayChatProps
| Prop | Type | Description |
| ------------------------ | ---------- | ------------------------------------------------------------------ |
| `openCitationInSameTab?` | `boolean` | Open the citation url in the same tab or not. Defaults to `false`. |
| `exampleQueries?` | `string[]` | Example queries to prompt the user to ask. Defaults to `[]`. |
### MintlifyWidgetTrackingFunctions
| Prop | Type | Description |
| --------------------- | ------------------------------------------ | -------------------------------------------------- |
| `trackChatEnter` | `()=> void` | Triggered when the user opens the chat widget. |
| `trackCitationClick` | `(title: string, url: string)=> void` | Triggered when the user clicks on a citation. |
| `trackChatThumbsUp` | `(query: string, response: string)=> void` | Triggered when the user thumbs up on a response. |
| `trackChatThumbsDown` | `(query: string, response: string)=> void` | Triggered when the user thumbs down on a response. |
| `trackChatFollowup` | `(query: string)=> void` | Triggered when the user asks a question. |
| `trackChatClose` | `(queriesCount: number)=> void` | Triggered when the user exits the chat widget. |
# Authentication
You can set authentication parameters to let users use their real API keys.
## Enabling Authentication
You can add an authentication method to your mint.json to enable it on every page or you can set it on a per-page basis.
The page's authentication method will override mint.json if both are set.
### Bearer Token
```json mint.json
"api": {
"auth": {
"method": "bearer"
}
}
```
```md Page Metadata
---
title: "Your page title"
authMethod: "bearer"
---
```
### Basic Authentication
```json mint.json
"api": {
"auth": {
"method": "basic"
}
}
```
```md Page Metadata
---
title: "Your page title"
authMethod: "basic"
---
```
### API Key
```json mint.json
"api": {
"auth": {
"method": "key",
"name": "x-api-key"
}
}
```
```md Page Metadata
---
title: "Your page title"
authMethod: "key"
---
```
### None
The "none" authentication method is useful to disable authentication on a specific endpoint after setting a default in mint.json.
```md Page Metadata
---
title: "Your page title"
authMethod: "none"
---
```
# MDX Setup
Generate docs pages for your API endpoints using MDX
Mintlify allows you to define your API endpoints using a combination of `mint.json` configuration, MDX metadata fields, and the `` component. From the defined endpoints, we generate an API playground, request examples, and response examples.
In your `mint.json` file, define your base URL and auth method:
```json
{
"api": {
"baseUrl": "https://mintlify.com/api", // string array for multiple base URLs
"auth": {
"method": "bearer" // options: bearer, basic, key.
}
}
}
```
If you would not like to show an API playground, you don't need to include auth types. Hide the playground with the following field:
```json
{
"api": {
"playground": {
"mode": "hide"
}
}
}
```
Find a full list of API configurations [here](/settings/global#api-configurations).
Each API endpoint page should have a corresponding MDX file. At the top of each file, define:
```md
---
title: 'Create new user'
api: 'POST https://api.mintlify.com/user'
---
```
You can specify path parameters by adding the parameter name to the path, wrapped with `{}`:
```bash
https://api.example.com/v1/endpoint/{userId}
```
If you have `baseUrl` configured in [mint.json](/settings/global), you can use relative paths like `/v1/endpoint`.
Add your endpoint pages to the sidebar by adding the paths to the `navigation` field in your `mint.json`. Learn more about structuring your docs [here](/settings/navigation).
# Advanced Features
Support for advanced OpenAPI features
OpenAPI 3 has some advanced features for describing complex APIs. Here's how you can use them with Mintlify.
## `oneOf`, `anyOf`, `allOf`
For complex datatypes, OpenAPI provides the `oneOf`, `anyOf`, and `allOf` keywords, allowing you to combine schemas in certain ways. You can read more about these keywords in the [Swagger documentation](https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/), but essentially:
* `oneOf` functions like an "exclusive-or" operator
* `anyOf` functions like an "or" operator
* `allOf` functions like an "and" operator
Mintlify treats the `oneOf` and `anyOf` keywords the same. We have found that, when people use `oneOf`, they often *mean* `anyOf` - and there is often no meaningful difference to the user.Mintlify currently does not support the `not` keyword.
### Combining schemas with `allOf`
Mintlify performs some preprocessing on your OpenAPI document to display these complex combinations in a readable way. For example, when you combine two object schemas with `allOf`, Mintlify combines the properties of both into a single object. This becomes especially useful when leveraging [OpenAPI's reusable `components`](https://swagger.io/docs/specification/components/).
```yaml
org_with_users:
allOf:
- $ref: '#/components/schemas/Org'
- type: object
properties:
users:
type: array
description: An array containing all users in the organization
...
components:
schemas:
Org:
type: object
properties:
id:
type: string
description: The ID of the organization
```
The ID of the organization
An array containing all users in the organization
### Providing options with `oneOf` and `anyOf`
When you use `oneOf` or `anyOf`, Mintlify displays the options in a tabbed container. To give your options helpful names, make sure to give each subschema a `title` field. For example, here's how you might display two different types of delivery addresses:
```yaml
delivery_address:
oneOf:
- title: StreetAddress
type: object
properties:
address_line_1:
type: string
description: The street address of the recipient
...
- title: POBox
type: object
properties:
box_number:
type: string
description: The number of the PO Box
...
```
The street address of the residence
The number of the PO Box
## `x-codeSamples`
If your users interact with your API using an SDK rather than directly through a network request, you can add code samples to your OpenAPI document, and Mintlify will display them in your OpenAPI pages. You can define your code samples using the `x-codeSamples` extension. This property can be added within any request method, and has the following schema:
The language of the code sample.
The label for the sample. This is useful when providing multiple examples for a single endpoint.
The source code of the sample.
Here's an example of some code samples for a plant tracking app, which has both a Bash CLI tool and a JavaScript SDK.
```yaml
paths:
/plants:
get:
...
x-codeSamples:
- lang: bash
label: List all unwatered plants
source: |
planter list -u
- lang: javascript
label: List all unwatered plants
source: |
const planter = require('planter');
planter.list({ unwatered: true });
- lang: bash
label: List all potted plants
source: |
planter list -p
- lang: javascript
label: List all potted plants
source: |
const planter = require('planter');
planter.list({ potted: true });
```
# OpenAPI Setup
Reference OpenAPI endpoints in your docs pages
## Add an OpenAPI specification file
To describe your endpoints with OpenAPI, make sure you have a valid OpenAPI
document in either JSON or YAML format that follows the
[OpenAPI specification](https://swagger.io/specification/). Your document must
follow OpenAPI specification 3.0+.
## Auto-populate API pages
The fastest way to get started with OpenAPI is to add an `openapi` field to a tab or anchor in the `mint.json`. This field can contain either the path to an OpenAPI document in your docs repo, or the URL of a hosted OpenAPI document. Mintlify will automatically generate a page for each OpenAPI operation and place them in the tab/anchor.
**Example with Anchors:**
```json {5}
{
"anchors": [
{
"name": "API Reference",
"openapi": "/path/to/openapi.json",
"url": "api-reference",
"icon": "square-terminal"
}
]
}
```
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/anchors-autogeneration-anchors.png)
**Example with Tabs:**
```json {6}
{
"tabs": [
{
"name": "API Reference",
"url": "api-reference",
"openapi": "https://petstore3.swagger.io/api/v3/openapi.json"
}
]
}
```
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/autogeneration-with-tabs.png)
To validate your OpenAPI spec, you can use this command: `mintlify openapi-check `
When using this option, the metadata for the generated pages will have the following default values:
* `title`: The `summary` field from the OpenAPI operation, if present. Otherwise a title generated from the HTTP method and endpoint.
* `description`: The `description` field from the OpenAPI operation, if present.
* `version`: The `version` value from the anchor or tab, if present.
There are some scenarios in which the default behavior isn't sufficient. If you need more customizability, you can create an MDX page for your OpenAPI operation, and modify it just like any other MDX page.
## Create MDX files for API pages
If you want to customize the page metadata, add additional content, omit certain OpenAPI operations, or reorder OpenAPI pages in your navigation, you'll need an MDX page for each operation. Here is [an example MDX OpenAPI page](https://github.com/elevenlabs/elevenlabs-docs/blob/e5e267c97b8d1e4c21db1dcdb8b005eb1dfed7da/api-reference/speech-to-speech.mdx?plain=1#L2) from [Elevenlabs](https://elevenlabs.io/docs/api-reference/speech-to-speech).
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/elevenlabs-mdx-autogeneration-example.png)
### Autogenerate files
For large OpenAPI documents, creating one MDX page for each OpenAPI operation can be a lot of work. To make it easier, we created a local OpenAPI page scraper.
Our Mintlify [scraper](https://www.npmjs.com/package/@mintlify/scraping)
autogenerates MDX files for your OpenAPI endpoints. Use the relative path to the
OpenAPI document in your codebase.
```bash
npx @mintlify/scraping@latest openapi-file
```
Add the `-o` flag to specify a folder to populate the files into. If a folder is
not specified, the files will populate in the working directory.
```bash
npx @mintlify/scraping@latest openapi-file -o api-reference
```
Learn more about our scraping package [here](https://www.npmjs.com/package/@mintlify/scraping).
The scraper will output an array of
[Navigation entries](/settings/global#structure) containing your OpenAPI MDX
files. You can either append these entries to your existing Navigation, or
reorder and add the files to your navigation manually.
If your OpenAPI document is invalid, the files will not autogenerate.
### Manually specify files
You can always create an MDX page manually, and reference the OpenAPI operation in the page's metadata using the `openapi` field.
By using the OpenAPI reference, the name, description, parameters, responses,
and the API playground will be automatically generated from the OpenAPI document.
If you have multiple OpenAPI files, include the path to the OpenAPI file to ensure Mintlify finds the correct OpenAPI document. This is not required if you have
only one OpenAPI file - it will automatically detect your OpenAPI file.
```md Example
---
title: "Get users"
openapi: "/path/to/openapi-1.json GET /users"
---
```
```md Format
---
title: "title of the page"
openapi: openapi-file-path method path
---
```
The method and path must match the method and path specified in the OpenAPI
document exactly. If the endpoint doesn't exist in the OpenAPI file,
the page will be empty.
## Create MDX files for OpenAPI schemas
Mintlify also allows you to create individual pages for any OpenAPI schema
defined in an OpenAPI document's `components.schemas` field:
```md Example
---
openapi-schema: OrderItem
---
```
```md Format
---
openapi-schema: "schema-key"
---
```
# Writing OpenAPI
Use OpenAPI features to enhance your Mintlify docs
## Describing your API
There are many great tools online for learning about and constructing OpenAPI documents. Here are our favorites:
* [Swagger's OpenAPI Guide](https://swagger.io/docs/specification/about/) for familiarizing yourself with the OpenAPI syntax
* [OpenAPI v3.1.0 Specification](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md) for all the details about the newest OpenAPI specification
* [Swagger & OpenAPI Validator](https://apitools.dev/swagger-parser/online/) for debugging your OpenAPI document
* [Swagger's Editor](https://editor.swagger.io/) for seeing examples in action
Swagger's OpenAPI Guide is for OpenAPI v3.0, but nearly all of the information is applicable to v3.1. For more information on the differences between v3.0 and v3.1, check out [OpenAPI's blog post](https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0).
## Specifying the URL for your API
In an OpenAPI document, different API endpoints are specified by their paths, like `/users/{id}`, or maybe simply `/`. To specify the base URL to which these paths should be appended, OpenAPI provides the `servers` field. This field is necessary to use some Mintlify features like the API Playground. Read how to configure the `servers` field in the [Swagger documentation](https://swagger.io/docs/specification/api-host-and-base-path/).
The API Playground will use these server URLs to determine where to send requests. If multiple servers are specified, a dropdown will appear to allow toggling between servers. If no server is supplied, the API Playground will use simple mode, as there is no way to send a request.
If different endpoints within your API exist at different URLs, you can [override the server field](https://swagger.io/docs/specification/api-host-and-base-path/#:~:text=%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%C2%A0%20%2D%20southeastasia-,Overriding%20Servers,-The%20global%20servers) for a given path or operation.
## Specifying authentication
Nearly all APIs require some method of authentication. OpenAPI provides the `securitySchemes` field for defining the methods of authentication used throughout your API, with simple configuration for the most common authentication types - [Basic](https://swagger.io/docs/specification/authentication/basic-authentication/), [Bearer](https://swagger.io/docs/specification/authentication/bearer-authentication/), and [API Keys](https://swagger.io/docs/specification/authentication/api-keys/). To apply these authentication methods to your endpoints, OpenAPI uses the `security` field. The syntax for defining and applying authentication is a bit unintuitive, so definitely check out [Swagger's documentation and examples](https://swagger.io/docs/specification/authentication/) on the topic.
The API descriptions and API Playground will add authentication fields based on the security configurations in your OpenAPI document.
If different endpoints within your API require different methods of authentication, you can [override the security field](https://swagger.io/docs/specification/authentication/#:~:text=you%20can%20apply%20them%20to%20the%20whole%20API%20or%20individual%20operations%20by%20adding%20the%20security%20section%20on%20the%20root%20level%20or%20operation%20level%2C%20respectively.) for a given operation.
# Interactive Playground
GET /plants/{id}
Enable users to interact with your API
The API playground is an interactive environment to make requests and preview an API endpoint.
Autogenerating API pages with OpenAPI will automatically generate API
playground. Read more about using OpenAPI with Mintlify
[here](/api-playground/openapi).
# Troubleshooting
Common issues with API References
API pages are complicated. As a result, there are a lot of things that can go wrong.
Here's a list of common issues we've seen customers run into:
In this scenario, it's likely that either Mintlify cannot find your OpenAPI document,
or your OpenAPI document is invalid.
Running `mintlify dev` locally should reveal some of these issues.
To verify your OpenAPI document will pass validation:
1. Visit [this validator](https://apitools.dev/swagger-parser/online/)
2. Switch to the "Validate text" tab
3. Paste in your OpenAPI document
4. Click "Validate it!"
If the text box that appears below has a green border, your document has passed validation.
This is the exact validation package Mintlify uses to validate OpenAPI documents, so if your document
passes validation here, there's a great chance the problem is elsewhere.
Additionally, Mintlify does not support OpenAPI 2.0. If your document uses this version of the specification,
you could encounter this issue. You can convert your document at [editor.swagger.io](https://editor.swagger.io/) (under Edit > Convert to OpenAPI 3):
This is usually caused by a misspelled `openapi` field in the page metadata. Make sure
the HTTP method and path match the HTTP method and path in the OpenAPI document exactly.
Here's an example of how things might go wrong:
```md get-user.mdx
---
openapi: "GET /users/{id}/"
---
```
```yaml openapi.yaml
paths:
"/users/{id}":
get: ...
```
Notice that the path in the `openapi` field has a trailing slash, whereas the path in the OpenAPI
document does not.
Another common issue is a misspelled filename. If you are specifying a particular OpenAPI document
in the `openapi` field, ensure the filename is correct. For example, if you have two OpenAPI
documents `openapi/v1.json` and `openapi/v2.json`, your metadata might look like this:
```md api-reference/v1/users/get-user.mdx
---
openapi: "v1 GET /users/{id}"
---
```
If you have a custom domain configured, this could be an issue with your reverse proxy. By
default, requests made via the API Playground start with a `POST` request to the
`/api/request` path on the docs site. If your reverse proxy is configured to only allow `GET`
requests, then all of these requests will fail. To fix this, configure your reverse proxy to
allow `POST` requests to the `/api/request` path.
Alternatively, if your reverse proxy prevents you from accepting `POST` requests, you can configure
Mintlify to send requests directly to your backend with the `api.playground.disableProxy`
setting in the `mint.json`, as described [here](/settings/global#api-configurations). This will
likely require you to configure CORS on your server, as these requests will now come directly
from your users' browsers.
# Product Updates
New updates and improvements
## Authentication
Make docs private by setting up authentication via JWT, OAuth, or a universal password. With this privacy, you can create an internal knowledge base or prevent competitors from seeing your docs.
## AI Assistant
You can now ask AI to make changes to your docs, with the context of all existing documentation. Type in a prompt and the assistant will propose changes by generating a pull request.
## GitLab Integration Upgrade
We've improved our support for syncing with GitLab, such as enabling automated updates and preview deployments. Check out our [docs on GitLab](/settings/gitlab) to get started.
## Web Editor
We've revamped our web editor so that you can now update docs with a fully WYSIWYG experience, while syncing with markdown.
Check out our [docs on getting started with Web Editor](/web-editor).
## /llms.txt support
All docs instances are now automatically hosted at /llms.txt and /llms-full.txt so that LLMs can easily ingest your documentation. For more information, read the [docs on the new llms.txt standard.](https://llmstxt.org)
## Localization
You can now localize your docs which operates similarly to versioning. Add a `locale` to a version and fixed content in Mintlify like "Was this page helpful?" will also match the locale.
### Quality Improvements
* Return chat & search results based on the current version that the user is reading
* Authenticate users with OAuth, in addition to JWT or Shared Session tokens.
## Changelogs
Launched a new [Update component](/content/components/update) to make it easier to display and report updates (like this one) to your users.
## Code Line Highlighting
You can now highlight lines of code in your docs to emphasize and bring attention to important parts by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````md
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
## Light mode code blocks
Code blocks now have a light mode variant which can be enabled by adding the following to your `mint.json`:
```json
"codeBlock": {
"mode": "auto"
}
```
## Advanced Footer
You can now add more links to the standard footer. This upgrade
provides more consistency between landing pages and docs, or greater customization
if you want to spotlight specific pages like socials or status logs.
## Filter search based on the current user
When personalization is enabled, search results are now filtered based on the current logged in user so that they only see the relevant content.
## Custom Prompts for AI Chat
You can now customize the prompts for the AI chat. Please reach out to [support](mailto:sales@mintlify.com) if you'd like to customize the prompts.
## Dashboard Improvements
* Added ability to change custom domain to be /docs directly through dashboard settings.
* Consolidated the login and signup pages to decrease friction and confusion.
* Implemented the discovery login flow so that users that are members of multiple organizations can now switch between them.
* Added login with Google OAuth
* Added ability to add new deployment through dashboard settings.
## Bug Fixes
* Can now use leading slashes in navigation.
* Can now edit CSS & JS files in the web editor.
* Fixed `suggestEdit` not showing up even when enabled.
* Fixed keyboard navigation for Search and Chat such that you can now use the up and down arrow keys to navigate the results.
* Don't allow search engines to crawl user-auth protected pages.
* Revalidate the cache when an org is deleted.
* We now use the Scalar OpenAPI parser to parse OpenAPI definitions which improves the performance, fixes parsing issues, and surfaces better error messages.
* Top-level descriptions are now supported in API reference pages autogenerated from OpenAPI definitions.
* Add in-line-style support for icons
* Fixed the pop-in of custom CSS in docs.
* Properly show in-line code styling in conjunction with links.
* Maintain scroll position when you click the back button in a browser.
## Custom Fonts
Personalize the font of your docs to your own font hosted on a CDN or by choosing from Google fonts to match your docs with your brand.
## Images in Card components
Add an `img` property to a card to display an image on the top of the card. Learn more about it [here](/content/components/cards#image-card).
## Update Speed Performances
For large projects (\~3,000 files), the download step for docs updates is now
\~440x faster - a 99.8% time reduction. Across the board, file downloads during
updates are now \~5.5x faster - an 81.8% time reduction.
## SEO improvements
We've fixed both the mobile and desktop layout of our docs so that they are more SEO-friendly - including adding proper aria tags to navbar and toggle elements.
## Dashboard Improvements
* App router migration in the dashboard.
* Search analytics are now available in the dashboard.
* Delete an org functionality has been added to the dashboard.
* Shipped GitLab connection UI.
* Fix incorrect analytics data.
* Add-on's can now be directly purchased through the dashboard.
## Bug Fixes
* Fixed a bug where the top bar would not stretch to the width of the screen when it's in custom mode and the sidebar layout is `sidenav`.
* Fix relative positioning of the AI widget.
## More
* **Troubleshooting for API pages**: API pages could be complicated so we listed
common issues to help you sort them out quickly —
[Read the docs](/api-playground/troubleshooting)
## OpenAPI Reference Pages
* Endpoints defined by OpenAPI that are complex and recursive are now 98%
smaller.
* We now show
[additionalProperties](https://swagger.io/docs/specification/data-models/dictionaries/)
in OpenAPI pages.
## File Uploads in API Playground
By default, API playground requests are proxied by Mintlify. Now you can use
`disableProxy` to disable this behavior and support request types like file
uploads.
* [Learn more about API configurations](/settings/global#api-configurations)
## Mobile SEO improvements
We've fixed the mobile layout of our docs so that they are more SEO-friendly -
including adding proper aria tags to elements.
## Support Form
We added a more detailed support form to the Mintlify dashboard. You can now
submit a form to get in touch with us.
## Bug Fixes
* Fixed a bug for the Segment integration functionality.
* We now raise more granular error messages for GitHub permissions when
interacting with the editor.
* Fixed bugs where the navigation would not properly expand when a direct link
was used.
## AI Widget
For `Pro` users, we introduced Mintlify Widget, an extension of your docs to
answer your users' questions when and where they asked. You can add this
AI-powered chatbot to any web page: your landing page, inside your product, or
on your existing documentation pages.
* [Read the blog announcement](https://mintlify.com/blog/widget)
* [Learn how to install the Widget](/advanced/widget/chat#getting-started)
## Pro Plan
We also updated our pricing plans for better customizability and scale.
* [Read the blog announcement](https://mintlify.com/blog/pro-plan)
## API Playground Code Example Sync
When you browse API docs, the selected code example now syncs across your pages.
## Insights
Currently in beta, this feature summarizes common user questions and patterns
into easy-to-digest reports with AI-powered suggestions on how to improve your
product.
## Launch Week Highlights
* Themes: Customize your styling with pre-configured themes. Just add the theme Quill, Prism, or Venus to your `mint.json` file and it'll update your docs styling.
* Search V2: directly query OpenAPI endpoint descriptions and titles to reach API Reference pages, remove hidden pages from search, and enjoy our updated searchbar UI.
* Web Editor branching: create branches in our web editor without an IDE.
* User Personalization: authenticate users with Shared Session or JWT so that you can show them customized content, such as pre-filling API keys or showing specific content for customers.
* OepenAPI Automation Upgrades: to auto-populate API Playground pages, you can add an `openapi` field to an object in tabs or anchors arrays in the mint.json.
## Okta SSO
We now support sign-on via Okta SAML and OIDC.
## Mintlify REST API
Programmatically rigger updates to your documentation.
## Custom mode
Add a configuration to the metadata to remove all elements except for the top bar.
Example use cases:
* Create a custom global landing page setup with custom components
* Add full-screen videos or image galleries
* Embed custom iFrame demo elements to add intractability to your docs
Check out our [Custom Mode docs](/page#custom-mode).
## Mintlify MDX for VSCode
Call snippets of our pre-built components an dcallouts without leaving VSCode. [Install the extension here](https://marketplace.visualstudio.com/items?itemName=mintlify.mintlify-snippets).
## Quality Improvements
* Dashboard upgrades: view update logs to see what's changed and status of an update, toggle between Mintlify projects to manage deployments
* Versioning with tabs fully supported
* Wildcard redirects now supported
* CLI Error Detection: we now show the position of invalid frontmatter when there are parsing issues during local development
## Launch Week Highlights
* Preview Deployments: When you create a pull request, we'll generate a unique link that shows a live preview of what your docs look like in prod. You can share this link with teammates.
* Snippets V2: We now support fully reusable components and variables for snippets.
* Open-source MDX Engine: We've exposed two APIs—getCompiledMdx and MDXComponent—so you can access Mintlify markdown and code syntax highlighting. [Contributions to the project](https://github.com/mintlify/mdx) are welcome.
* AI Chat Insights: Segment chat history by date and increase AI Chat quota from the dashboard, and see how often a specific query appears.
# Code Blocks
Display inline code and code blocks
## Basic
### Inline Code
To denote a `word` or `phrase` as code, enclose it in backticks (\`).
```
To denote a `word` or `phrase` as code, enclose it in backticks (`).
```
### Code Block
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language.
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````md
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
Visit the [Code Block page](/content/components/code) for more detailed docs.
# Accordion Groups
Group multiple accordions into a single display.
Simply add `` around your existing `` components.
You can put other components inside Accordions.
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
````jsx Accordion Group Example
You can put other components inside Accordions.
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
Check out the [Accordion](/content/components/accordions) docs for all the supported props.
````
`AccordionGroup` does not have any props.
# Accordions
A dropdown component to toggle content
You can put any content in here. Check out
[AccordionGroup](/content/components/accordion-groups) if you want to group
multiple Accordions into a single display.
```jsx Accordion Example
You can put any content in here.
```
## Props
Title in the Accordion preview.
Detail below the title in the Accordion preview.
Whether the Accordion is open by default.
A [Font Awesome icon](https://fontawesome.com/icons) or SVG code
One of "regular", "solid", "light", "thin", "sharp-solid", "duotone", or
"brands"
# Callout Boxes
Use callouts to add eye-catching context to your content
### Note Callouts
This adds a note in the content
```jsx
This adds a note in the content
```
### Warning Callouts
This raises a warning to watch out for
```jsx
This raises a warning to watch out for
```
### Info Callouts
This draws attention to important information
```jsx
This draws attention to important information
```
### Tip Callouts
This suggests a helpful tip
```jsx
This suggests a helpful tip
```
### Check Callouts
This brings us a checked status
```jsx
This brings us a checked status
```
# Card Groups
Show cards side by side in a grid format
The `CardGroup` component lets you group multiple `Card` components together. It's most often used to put multiple cards on the same column.
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit
Ut enim ad minim veniam, quis nostrud exercitation ullamco
Excepteur sint occaecat cupidatat non proident
```jsx Card Group Example
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet
Lorem ipsum dolor sit amet, consectetur adipiscing elit
Ut enim ad minim veniam, quis nostrud exercitation ullamco
Excepteur sint occaecat cupidatat non proident
```
## Props
The number of columns per row
# Cards
Highlight main points or links with customizable icons
This is how you use a card with an icon and a link. Clicking on this card
brings you to the Card Group page.
```jsx Card Example
This is how you use a card with an icon and a link. Clicking on this card
brings you to the Card Group page.
```
```jsx Image Card Example
Here is an example of a card with an image
```
### Horizontal Card
Add a `horizontal` property to a card to make it horizontally displayed.
Here is an example of a horizontal card
### Image Card
Add an `img` property to a card to display an image on the top of the card.
Here is an example of a card with an image
## Props
The title of the card
A [Font Awesome icon](https://fontawesome.com/icons) or SVG code in `icon={}`
One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`
The color of the icon as a hex code
The url that clicking on the card would navigate the user to
Makes the card more compact and horizontal
The url or local path to an image to display on the top of the card
# Code Blocks
Display code with optional syntax highlighting
````md Code Block Example
```javascript Code Block Example
const hello = "world";
```
````
## Basic Code Block
Use [fenced code blocks](https://www.markdownguide.org/extended-syntax/#fenced-code-blocks) by enclosing code in three backticks.
```
helloWorld();
```
````md
```
helloWorld();
```
````
## Syntax Highlighting
Put the name of your programming language after the three backticks to get syntax highlighting.
We use [Prism](https://prismjs.com/#supported-languages) for syntax highlighting. [Test Drive Prism](https://prismjs.com/test.html#language=markup) lists all the languages supported.
```java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````md
```java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
## Names
You can add more text after the programming language to set the name of your code example. The text can be anything as long as its all in one line.
```javascript Code Block Example
const hello = "world";
```
````md Code Block Example
```javascript Code Block Example
const hello = "world";
```
````
## Line Highlighting
You can highlight specific lines in your code blocks by adding a special comment after the language identifier. Use curly braces `{}` and specify line numbers or ranges separated by commas.
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````md
```javascript Line Highlighting Example {1,3-5}
const greeting = "Hello, World!";
function sayHello() {
console.log(greeting);
}
sayHello();
```
````
## Code Groups
Want to display multiple code examples in one code box? Check out the Code Group docs:
Read the reference for the Code Group component
# Code Groups
The CodeGroup component lets you combine code blocks in a display separated by tabs
You will need to make [Code Blocks](/content/components/code) then add the `` component around them. Every Code Block must have a filename because we use the names for the tab buttons.
See below for an example of the end result.
```javascript helloWorld.js
console.log("Hello World");
```
```python hello_world.py
print('Hello World!')
```
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````md Code Group Example
```javascript helloWorld.js
console.log("Hello World");
```
```python hello_world.py
print('Hello World!')
```
```java HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
```
````
# Expandables
Toggle to display nested properties.
The full name of the user
Whether the user is over 21 years old
```jsx Expandable Example
The full name of the user
Whether the user is over 21 years old
```
## Props
The name of the object you are showing. Used to generate the "Show NAME" and
"Hide NAME" text.
Set to true to show the component as open when the page loads.
# Frames
Use the Frame component to wrap images or other components in a container.
Frames are very helpful if you want to center an image.
## Captions
You can add additional context to an image using the optional `caption` prop.
## Props
Optional caption text to show centered under your component.
```jsx Frame
```
```jsx Frame with Captions
```
# Icons
Use [Font Awesome](https://fontawesome.com/icons) icons anywhere in the doc
```jsx Icon Example
```
## Inline Icons
The icon will be placed inline when used in a paragraph.
```markdown Inline Icon Example
The documentation you want, effortlessly
```
The documentation you want, effortlessly
## Props
A [Font Awesome](https://fontawesome.com/icons) icon
One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`
The color of the icon as a hex code (e.g., `#FF5733`)
The size of the icon in pixels
# Mermaid Diagrams
Display diagrams using Mermaid
````md Mermaid Flowchart Example
```mermaid
flowchart LR
subgraph subgraph1
direction TB
top1[top] --> bottom1[bottom]
end
subgraph subgraph2
direction TB
top2[top] --> bottom2[bottom]
end
%% ^ These subgraphs are identical, except for the links to them:
%% Link *to* subgraph1: subgraph1 direction is maintained
outside --> subgraph1
%% Link *within* subgraph2:
%% subgraph2 inherits the direction of the top-level graph (LR)
outside ---> top2
```
````
[Mermaid](https://mermaid.js.org/) lets you create visual diagrams using text and code.
```mermaid
flowchart LR
subgraph subgraph1
direction TB
top1[top] --> bottom1[bottom]
end
subgraph subgraph2
direction TB
top2[top] --> bottom2[bottom]
end
%% ^ These subgraphs are identical, except for the links to them:
%% Link *to* subgraph1: subgraph1 direction is maintained
outside --> subgraph1
%% Link *within* subgraph2:
%% subgraph2 inherits the direction of the top-level graph (LR)
outside ---> top2
```
You can create the following using Mermaid diagrams:
* Flowchart
* Sequence diagram
* Class diagram
* State diagram
* Entity relationship diagram
* User journey
* and more
For a complete list of diagrams supported by Mermaid, check out their [website](https://mermaid.js.org/).
## Syntax for Mermaid diagrams
To create a flowchart, you can write the Mermaid flowchart inside a Mermaid code block.
````md
```mermaid
// Your mermaid code block here
```
````
# Parameter Fields
Set path, query, and body parameters
`ParamField` components help define the parameters for your APIs or SDKs. Adding a ParamField will automatically add an [API Playground](/api-playground/overview).
An example of a parameter field
```jsx Path Example
An example of a parameter field
```
```jsx Query Example
The filtering command used to sort through the users
```
```jsx Body Example
The age of the user. Cannot be less than 0
```
## Props
Whether it is a query, path, body, or header parameter followed by the name
Expected type of the parameter's value
Indicate whether the parameter is required
Indicate whether the parameter is deprecated
Default value used by the server if the request does not provide a value
Value that will be used to initialize the playground
Placeholder text for the input in the playground
Description of the parameter (markdown enabled)
# Response Fields
Display API response values
The `` component is designed to define the return values of an API. Many docs also use `` on pages when you need to list the types of something.
A response field example
```jsx ResponseField Example
A response field example
```
## Props
The name of the response value.
Expected type of the response value
The default value.
Show "required" beside the field name.
# Steps
Sequence content using the Steps component
Steps are the best way to display a series of actions of events to your users. You can add as many steps as desired.
These are instructions or content that only pertain to the first step.
These are instructions or content that only pertain to the second step.
These are instructions or content that only pertain to the third step.
```jsx Steps Example
These are instructions or content that only pertain to the first step.
These are instructions or content that only pertain to the second step.
These are instructions or content that only pertain to the third step.
```
## Steps Props
A list of `Step` components.
The size of the step titles. One of `p`, `h2` and `h3`.
## Individual Step Props
The content of a step either as plain text, or components.
A [Font Awesome icon](https://fontawesome.com/icons) or SVG code in `icon={}`
One of `regular`, `solid`, `light`, `thin`, `sharp-solid`, `duotone`, `brands`
The title is the primary text for the step and shows up next to the indicator.
The number of the step.
The size of the step titles. One of `p`, `h2` and `h3`.
# Sidebar Code Examples
Display code blocks at the top-right of the page on desktop devices
The `` and `` stick code blocks to the top-right of a page even as you scroll. The components work on all pages even if you don't use an API playground.
`` and `` show up like regular code blocks on mobile.
## Request Example
The `` component works similar to [CodeGroup](/content/components/code-groups), but displays the request content on the right sidebar. Thus, you can put multiple code blocks inside ``.
Please set a name on every code block you put inside RequestExample.
````md RequestExample Example
```bash Request
curl --request POST \
--url https://dog-api.kinduff.com/api/facts
```
````
## Response Example
The `` component is the same as `` but will show up underneath it.
````md ResponseExample Example
```json Response
{ "status": "success" }
```
````
# Tabs
Toggle content using the Tabs component
You can add any number of tabs.
☝️ Welcome to the content that you can only see inside the first Tab.
✌️ Here's content that's only inside the second Tab.
💪 Here's content that's only inside the third Tab.
```jsx Tabs Example
☝️ Welcome to the content that you can only see inside the first Tab.
✌️ Here's content that's only inside the second Tab.
💪 Here's content that's only inside the third Tab.
```
## Tab Props
The title of the tab. Short titles are easier to navigate.
# Tooltips
Show a definition when you hover over text.
Hover over me and see a tooltip in action
```jsx Tooltip Example
Hover over me
```
# Update
Keep track of changes and updates
The `Update` component is used to keep track of changes and updates.
## Changelog
You can add anything here, like a screenshot, a code snippet, or a list of changes.
#### Features
* Responsive design
* Sticky section for each changelog
### How to use
```md
This is how you use a changelog with a label
and a description.
This is how you use a changelog with a label
and a description.
```
You can use multiple `Update` components to create changelogs.
Each `label` creates an anchor and also shows up on the table of contents on the right.
## Props
Label in the changelog, on the sticky left side.
Description below the label in the Changelog preview.
# Local Development
Preview changes locally to update your docs
**Prerequisite**: Please install Node.js (version 19 or higher) before proceeding.
**Step 1**: Install Mintlify:
```bash npm
npm i -g mintlify
```
```bash yarn
yarn global add mintlify
```
```bash pnpm
pnpm add -g mintlify
```
**Step 2**: Navigate to the docs directory (where the `mint.json` file is located) and execute the following command:
```bash
mintlify dev
```
Alternatively, if you do not want to install Mintlify globally you can use a run script available:
```bash npm
npx mintlify dev
```
```bash yarn
yarn dlx mintlify dev
```
```bash pnpm
pnpm dlx mintlify dev
```
Yarn's "dlx" run script requires yarn version >2. See [here](https://yarnpkg.com/cli/dlx) for more information.
A local preview of your documentation will be available at `http://localhost:3000`.
### Custom Ports
By default, Mintlify uses port 3000. You can customize the port Mintlify runs on by using the `--port` flag. To run Mintlify on port 3333, for instance, use this command:
```bash
mintlify dev --port 3333
```
If you attempt to run Mintlify on a port that's already in use, it will use the next available port:
```md
Port 3000 is already in use. Trying 3001 instead.
```
## Mintlify Versions
Please note that each CLI release is associated with a specific version of Mintlify. If your local website doesn't align with the production version, please update the CLI:
```bash npm
npm i -g mintlify@latest
```
```bash yarn
yarn global upgrade mintlify
```
```bash pnpm
pnpm up --global mintlify
```
## Validating Links
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
```bash
mintlify broken-links
```
## Deployment
If the deployment is successful, you should see the following:
## Code Formatting
We suggest using extensions on your IDE to recognize and format MDX. If you're a VSCode user, consider the [MDX VSCode extension](https://marketplace.visualstudio.com/items?itemName=unifiedjs.vscode-mdx) for syntax highlighting, and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) for code formatting.
## Troubleshooting
This may be due to an outdated version of node. Try the following:
1. Remove the currently-installed version of mintlify: `npm remove -g mintlify`
2. Upgrade to Node v19 or higher.
3. Reinstall mintlify: `npm install -g mintlify`
Solution: Go to the root of your device and delete the \~/.mintlify folder. Afterwards, run `mintlify dev` again.
# Images, Videos, and Embeds
Add image, video, and other HTML elements
Mintlify supports files up to 5 MB. To use larger files, consider a storage
service like Cloudinary and embed in your Mintlify documentation.
## Image
### Using Markdown
The [markdown syntax](https://www.markdownguide.org/basic-syntax/#images) lets you add images using the following code
```md
![title](/path/image.jpg)
```
Note that the image file size must be less than 5MB. Otherwise, we recommend hosting on a service like [Cloudinary](https://cloudinary.com/) or [S3](https://aws.amazon.com/s3/). You can then use that URL and embed.
### Using Embeds
To get more customizability with images, you can also use embeds to add images.
```html
```
### Disable Image Zoom
To disable the default zoom on click for images, add the noZoom property to image embeds.
```html
```
### Linking Images
To link an image, for example to create a button on your docs, encompass the image in a link with the `noZoom` property. Images in `a` tags will automatically have a pointer cursor.
```html
```
### Dark Mode
To use separate images for light and dark mode, use Tailwind CSS to hide and show images.
```html
```
### Related
For more information, we recommend the following sections:
Read the reference for the Frame component
## Videos
Mintlify supports [HTML tags in Markdown](https://www.markdownguide.org/basic-syntax/#html). This is helpful if you prefer HTML tags to Markdown syntax, and lets you create documentation with infinite flexibility.
For YouTube videos use:
```html
```
For other videos, use:
```html
```
To autoplay the video, use:
```html
```
Since Mintlify needs to adhere to the JSX syntax, double word attributes will need to
be written in camelCase: autoPlay, playsInline.
## iFrames
Loads another HTML page within the document.
```html
```
Although not required, we recommend adding the `alt` and `title` attributes to
images for better SEO and accessability. Learn more at [image
SEO](https://yoast.com/image-seo-alt-tag-and-title-tag-optimization/).
# Amplitude
Add the following to your `mint.json` file to send analytics to Amplitude.
```json Analytics options in mint.json
"analytics": {
"amplitude": {
"apiKey": "required"
}
}
```
```json Example
"analytics": {
"amplitude": {
"apiKey": "76bb138bf3fbf58186XXX00000"
}
}
```
# Clearbit
Add the following to your `mint.json` file to send analytics to Clearbit.
```json Analytics options in mint.json
"analytics": {
"clearbit": {
"publicApiKey": "required"
}
}
```
```json Example
"analytics": {
"clearbit": {
"publicApiKey": "pk_1a1882"
}
}
```
# Fathom
Add the following to your `mint.json` file to send analytics to Fathom.
You can get the `siteId` from your script settings.
```json Analytics options in mint.json
"analytics": {
"fathom": {
"siteId": "required"
}
}
```
```json Example
"analytics": {
"fathom": {
"siteId": "YSVMSDAY"
}
}
```
# Google Analytics 4
You will need to generate a new GA4 property to use with Mintlify. The data collected will go into the same project as your other Google Analytics data.
If you are using the old version of Google Analytics, Universal Analytics, you will still be able to generate a GA4 property. GA4 data is slightly different from UA data but still gets collected in the same project.
## How to Connect GA4 to Mintlify
### Create a Web Stream
You will need to create a web stream to get the Measurement ID to put into Mintlify.
Click the cog at the bottom left of the Google Analytics screen. Then click on Data Streams.
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/ga4-web-streams.png)
Create a Web Stream and put the URL of your Mintlify docs site as the stream URL.
Your Measurement ID looks like `G-XXXXXXX` and will show up under Stream Details immediately after you create the Web Stream.
### Put Measurement ID in mint.json
Add your Measurement ID to your `mint.json` file like so:
```json mint.json
"analytics": {
"ga4": {
"measurementId": "G-XXXXXXX"
}
}
```
### Wait
Google Analytics takes two to three days to show your data.
You can use the [Google Analytics Debugger](https://chrome.google.com/webstore/detail/google-analytics-debugger/jnkmfdileelhofjcijamephohjechhna?hl=en) to check analytics are enabled correctly. The extension will log to your browser's console every time GA4 makes a request.
Preview links have analytics turned off.
# Google Tag Manager
Add your tag ID to `mint.json` file and we'll inject the Google Tag Manager script to all your pages.
You are responsible for setting up cookie consent banners with Google Tag Manager if you need them.
```json Analytics options in mint.json
"analytics": {
"gtm": {
"tagId": "required"
}
}
```
```json Example
"analytics": {
"gtm": {
"tagId": "GTM-MGBL4PW"
}
}
```
# Heap
Add the following to your `mint.json` file to send analytics to Heap.
```json Analytics options in mint.json
"analytics": {
"heap": {
"appId": "required"
}
}
```
```json Example
"analytics": {
"heap": {
"appId": "1234567890"
}
}
```
# HotJar
Add the following to your `mint.json` file to send analytics to HotJar.
```json Analytics options in mint.json
"analytics": {
"hotjar": {
"hjid": "required",
"hjsv": "required"
}
}
```
# Koala
Add the following to your `mint.json` file to send analytics to Koala.
```json Analytics options in mint.json
"analytics": {
"koala": {
"publicApiKey": "required"
}
}
```
```json Example
"analytics": {
"koala": {
"publicApiKey": "pk_1a1882"
}
}
```
# LogRocket
Add the following to your `mint.json` file to send analytics to LogRocket.
```json Analytics options in mint.json
"analytics": {
"logrocket": {
"apiKey": "required"
}
}
```
# Mixpanel
Add the following to your `mint.json` file to send analytics to Mixpanel.
```json Analytics options in mint.json
"analytics": {
"mixpanel": {
"projectToken": "required"
}
}
```
# Analytics Integrations
Integrate with an analytics platform to track events
Automatically send data about your documentation engagement to your third party analytics provider.
## All Integrations
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
## Enabling Analytics
Set your analytics keys in `mint.json`. You can add an unlimited number of analytics integrations for free.
The syntax for `mint.json` is below. You only need to include entries for the platforms you want to connect.
```json Analytics options in mint.json
"analytics": {
"amplitude": {
"apiKey": "required"
},
"clearbit": {
"publicApiKey": "required"
},
"fathom": {
"siteId": "required"
},
"ga4": {
"measurementId": "required"
},
"gtm": {
"tagId": "required"
},
"hotjar": {
"hjid": "required",
"hjsv": "required"
},
"koala": {
"publicApiKey": "required"
},
"logrocket": {
"appId": "required"
},
"mixpanel": {
"projectToken": "required"
},
"pirsch": {
"id": "required"
},
"plausible": {
"domain": "required"
},
"posthog": {
"apiKey": "required",
"apiHost": "optional"
},
}
```
```json Google Analytics 4 Example
"analytics": {
"ga4": {
"measurementId": "G-XXXXXXX"
}
}
```
## FAQ
* `expandable_open`
* `expandable_close`
* `accordion_open`
* `accordion_close`
* `header_nav_item_click`
* `cta_click`
* `scroll_to_bottom`
* `search_close`
* `api_playground_call`
* `search_result_click`
* `chat_enter`
* `chat_followup`
* `chat_completed`
* `code_block_copy`
* `chat_shared`
* `thumb_vote`
* `powered_by_mintlify_click`
* `ai_chat_citation_click`
* `ai_chat_feedback_positive_click`
* `ai_chat_feedback_negative_click`
# Pirsch
Add the following to your `mint.json` file to send analytics to Pirsch.
You can get your site ID from Settings > Developer > Identification Code.
```json Analytics options in mint.json
"analytics": {
"pirsch": {
"id": "required"
}
}
```
```json Example
"analytics": {
"pirsch": {
"id": "8Kw7OKxBfswOjnKGZa7P9Day8JmVYwTp"
}
}
```
# Plausible
Add your site's domain to `mint.json` to send analytics to Plausible.
Do not include `https://` for the domain or server.
```json Analytics options in mint.json
"analytics": {
"plausible": {
"domain": "required",
"server": "optional"
}
}
```
```json Example
"analytics": {
"plausible": {
"domain": "docs.domain.com"
}
}
```
# PostHog
Add the following to your `mint.json` file to send analytics to PostHog.
You only need to include `apiHost` if you are self-hosting PostHog. We send events to `https://app.posthog.com` by default.
```json Analytics options in mint.json
"analytics": {
"posthog": {
"apiKey": "required",
"apiHost": "optional"
}
}
```
```json Example
"analytics": {
"posthog": {
"apiKey": "phc_TXdpocbYTeZVm5VJmMzHTMrCofBQu3e0kN7HGMNGTVW"
}
}
```
Enabling PostHog analytics will disable the analytics on the Mintlify dashboard.
## Session Recordings
You need to add the URL for your docs website to Posthog's "Authorized domains for recordings" before you can receive session recordings. The option to add your URL is in Posthog's project settings.
# Osano
Add the following to your `mint.json` file to add the [Osano](https://www.osano.com/) cookie consent manager.
```json Integration options in mint.json
"integrations": {
"osano": "SOURCE"
}
```
```json Example
"integrations": {
"osano": "https://cmp.osano.com/2sUB2dqwqdkks/8dqwd-dwd86£-4a9b/osano.js"
}
```
The `SOURCE` can be found as the `src` value in the code snippet generated by Osano. It always starts with `https://cmp.osano.com/`.
```html Code snippet from Osano
```
# Privacy Integrations
Integrate with a data privacy platform
} horizontal />
## Enabling Data Privacy Integrations
You can add data privacy platforms onto your docs. Add the `integrations` field into your `mint.json` file with your respective scripts.
```json
"integrations": {
"osano": "SOURCE"
}
```
If you'd like to request a data privacy platform integration, please let us know in [our community](https://mintlify.com/community).
# Speakeasy
Automate your SDK usage snippets in the API playground
You can integrate Speakeasy-generated code snippets from your SDKs directly into your Mintlify API reference documentation. SDK usage snippets are shown in the [interactive playground](https://mintlify.com/docs/api-playground/overview) of your Mintlify-powered documentation.
## Speakeasy SDK Repository Changes
In your Speakeasy SDK repos, add the following to the `targets` section of your `.speakeasy/workflow.yaml` file to ensure code samples are automatically produced alongside SDK generations.
```yaml .speakeasy/workflow.yaml
targets:
my-target:
target: typescript
source: my-source
codeSamples:
output: codeSamples.yaml
```
Code samples will be generated in the form of an [OpenAPI overlay file](https://www.speakeasyapi.dev/openapi/overlays) that will be used in the Mintlify docs repository.
## Mintlify Docs Repository Changes
The workflow files produced will automatically bundle your source OpenAPI spec and Speakeasy code samples into a single output file, `openapi.yaml`. Mintlify will use this output file when constructing your API reference.
### Interactive CLI Set Up
Run the following commands to set up the `.speakeasy/workflow.yaml` and `.github/workflows/sdk_generation.yaml` files through the interactive Speakeasy CLI.
```bash
speakeasy configure sources
speakeasy configure github
```
Set up your source spec. The source spec is the OpenAPI spec that code samples will be generated for, and it's often the same specification used to power Mintlify docs.
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/speakeasy-1.webp)
Add the overlay created by Speakeasy to inject code snippets into your spec.
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/speakeasy-2.webp)
Provide a name and path for the OpenAPI spec. This will be the final spec used by Mintlify.
![](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/speakeasy-3.webp)
Finally, Add your `SPEAKEASY_API_KEY` as a repository secret to your Minlify repo under `Settings > Secrets & Variables > Actions`. Find the Speakeasy API key in the Speakeasy dashboard under the **API Keys** tab.
## Manual Set Up
Alternatively, you can manually set up the following files in your Mintlify docs repo.
```yaml .speakeasy/workflow.yaml
workflowVersion: 1.0.0
sources:
docs-source:
inputs:
- location: {{your_api_spec}} # local or remote references supported
overlays:
- location: https://raw.githubusercontent.com/{{your_sdk_repo_1}}/codeSamples.yaml
- location: https://raw.githubusercontent.com/{{your_sdk_repo_2}}/codeSamples.yaml
- location: https://raw.githubusercontent.com/{{your_sdk_repo_3}}/codeSamples.yaml
output: openapi.yaml
targets: {}
```
```yaml .speakeasy/workflows/sdk_generation.yaml
name: Generate
permissions:
checks: write
contents: write
pull-requests: write
statuses: write
"on":
workflow_dispatch:
inputs:
force:
description: Force generation of SDKs
type: boolean
default: false
schedule:
- cron: 0 0 * * *
jobs:
generate:
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
with:
force: ${{ github.event.inputs.force }}
mode: pr
speakeasy_version: latest
secrets:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}
```
Finally, make sure you add your `SPEAKEASY_API_KEY` as a repository secret to your Minlify repo under `Settings > Secrets & Variables > Actions`. Find the Speakeasy API key in the Speakeasy dashboard under the **API Keys** tab.
# Stainless
Automate your SDK example snippets in the API playground
If you use Mintlify's OpenAPI support for your API reference documentation, add the following to your Stainless config:
```yaml openapi.stainless.yml
openapi:
code_samples: mintlify
```
Configure the [OpenAPI setup](/api-playground/openapi/setup#in-the-repo) in your Mintlify docs. To integrate Stainless, modify the GitHub Action that uploads your OpenAPI spec to Stainless so that it pushes the Stainless-enhanced OpenAPI spec into your docs repo like so:
```yaml
name: Upload OpenAPI spec to Stainless and (Mintlify) docs repo
on:
push:
branches: [main]
workflow_dispatch:
jobs:
stainless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Push spec and config to Stainless and outputs documented spec
uses: stainless-api/upload-openapi-spec-action@main
with:
input_path: 'path/to/my-company-openapi.json'
config_path: 'path/to/my-company.stainless.yaml'
output_path: 'path/to/my-company-openapi.documented.json'
project_name: 'my-stainless-project'
- name: Push documented spec to docs repo
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'config/my-company-openapi.documented.json'
destination_repo: '{DOCS_REPO_NAME}'
destination_folder: 'openapi-specs' # (optional) the folder in the destination repository to place the file in, if not the root directory
user_email: '{EMAIL}' # the email associated with the GH token
user_name: '{USERNAME}' # the username associated with the GH token
commit_message: 'Auto-updates from Stainless'
```
This assumes the following secrets have been [uploaded to your GitHub Actions Secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions):
* `secrets.STAINLESS_API_KEY`: Your Stainless API key.
* `secrets.API_TOKEN_GITHUB`: A GitHub [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with permissions to push to your docs repo.
# Front
Add the following to your `mint.json` file to add a [Front Chat](https://front.com) widget.
```json Integration options in mint.json
"integrations": {
"frontchat": "CHAT_ID"
}
```
```json Example
"integrations": {
"frontchat": "1365d046d7c023e9b030ce90d02d093a"
}
```
# Intercom
Add the following to your `mint.json` file to add an [Intercom](https://www.intercom.com) widget.
```json Integration options in mint.json
"integrations": {
"intercom": "APP_ID"
}
```
```json Example
"integrations": {
"intercom": "x2pg8cwb"
}
```
# Support Integrations
Integrate with a support widget
} horizontal />
}
horizontal
/>
## Enabling Support Integrations
You can integrate widgets onto your docs for customer support. Add the `integrations` field into your `mint.json` file with your respective app ID.
```json
"integrations": {
"intercom": "APP_ID",
"frontchat": "CHAT_ID"
}
```
If you'd like to request a customer support integration, please let us know in [our community](https://join.slack.com/t/mintlify-users/shared_invite/zt-1xfzz6x35-f4o4WCYfpvLhSj3O7WAOMA).
# Lists and Tables
Display information in lists and tables
## Lists
### Ordered List
To create an ordered list, add line items with numbers followed by periods
1. First item
2. Second item
3. Third item
4. Fourth item
```md
1. First item
2. Second item
3. Third item
4. Fourth item
```
### Unordered List
To create an unordered list, add dashes (`-`), asterisks (`*`), or plus signs (`+`) in front of line items
* First item
* Second item
* Third item
* Fourth item
```md
- First item
- Second item
- Third item
- Fourth item
```
### Nested List
Add indents on list items to nest them
* First item
* Second item
* Additional item
* Additional item
* Third item
```md
- First item
- Second item
- Additional item
- Additional item
- Third item
```
Lists follow the official [markdown syntax](https://www.markdownguide.org/basic-syntax/#lists-1).
## Tables
| Property | Description |
| -------- | ------------------------------------- |
| Name | Full name of user |
| Age | Reported age |
| Joined | Whether the user joined the community |
### Creating a table
The Table component follows the official [markdown syntax](https://www.markdownguide.org/extended-syntax/#tables).
To add a table, use three or more hyphens (`---`) to create each column's header, and use pipes (`|`) to separate each column. For compatibility, you should also add a pipe on either end of the row.
```md
| Property | Description |
| -------- | ------------------------------------- |
| Name | Full name of user |
| Age | Reported age |
| Joined | Whether the user joined the community |
```
# Migration
How to migrate documentation from your existing provider
You can use our [public packages](https://www.npmjs.com/package/@mintlify/scraping) to scrape documentation frameworks to Mintlify.
We currently support migration for:
}
/>
}
/>
}
/>
Don't see your docs provider or have a home grown system? We can still help! Please get in touch at [sales@mintlify.com](mailto:sales@mintlify.com).
## Commands
* `mintlify-scrape section [url]` - Scrapes multiple pages in a site.
* `mintlify-scrape page [url]` - Scrapes a single page in a site.
The commands will automatically detect the framework.
## 🚀 Installation
First, install the package:
```
npm i @mintlify/scraping
```
One-time use:
```bash Section
npx @mintlify/scraping@latest section [url]
```
```bash Page
npx @mintlify/scraping@latest page [url]
```
Global installation:
```
npm install @mintlify/scraping@latest -g
```
Global usage:
```bash Section
mintlify-scrape section [url]
```
```bash Page
mintlify-scrape page [url]
```
Provide the relative path or URL to the OpenAPI file to generate frontmatter files for each endpoint.
```
mintlify-scrape openapi-file [openApiFilename]
-w, --writeFiles Whether or not to write the frontmatter files [boolean] [default: true]
-o, --outDir The folder in which to write any created frontmatter files [string]
```
# Page Titles and Metadata
Setting the title and metadata for navigation and SEO
## The Basics
Each page is an MDX file that should begin with the following metadata syntax
with `---` at the start and end:
```md Schema
---
title: "title of the page"
---
```
```md Example
---
title: "Page"
---
```
Mintlify will use the name of the file if you forget to include a title.
Other metadata goes in between the same `---` lines. For example, this page uses
this metadata:
```md
---
title: "Page Titles and Metadata"
description: "Setting the title and metadata for navigation and SEO"
---
```
## API Pages
API pages let you build interactive API playgrounds. To create an API page, you
must set an `api` or `openapi` property in the page metadata.
Learn more about API playgrounds in [our demo](/api-playground).
```md Schema
api or openapi: method endpoint
```
```md API Example
api: "GET /users"
```
```md OpenAPI Example
openapi: "GET /users"
```
## Descriptions
You can show a description that shows directly under the title with the
`description` metadata.
```md
description: "Your description goes here."
```
## Sidebar Title
You can show a different title in the navigation with the `sidebarTitle`
metadata. This is useful if your title is long and you want something shorter in
the navigation links.
```md
---
title: "Your very long page title you want to shorten"
sidebarTitle: "Short title"
---
```
## Sidebar Icons
Want an icon for your sidebar item like the ones in
[components](/content/components/accordions)? You can set an `icon` attribute in
the metadata! All icons from [Font Awesome](https://fontawesome.com/icons) are
available for us. You can also set an icon type (optional). If not set, the icon
type will be regular.
```md
---
title: "Code Block"
icon: "rectangle-code"
iconType: "solid"
---
```
## Page Mode
The Page Mode setting allows you to customize the appearance of your page. You can choose from
different modes to adjust the layout according to your needs. If no mode is specified, the page
will use the default settings.
### No Mode
If no specific mode is given, the page will default to standard settings. This means the page
will display with the default table of contents (if headings are present) and other standard
elements, providing a typical layout without any special adjustments.
```md
---
title: "Page with no ToC"
---
```
### Wide Mode
In *Wide Mode*, you can hide the table of contents (ToC) on the right side of the page. This is
particularly useful if your page doesn’t have any headings or if you prefer to utilize the
extra horizontal space for other content.
```md
---
title: "Page with no ToC"
mode: "wide"
---
```
### Custom Mode
*Custom Mode* provides a minimalist layout by removing all elements except for the top bar.
This mode offers a blank canvas, which is ideal for creating a "landing page" or any page where
you want a clean, distraction-free environment.
```md
---
mode: "custom"
---
```
### Center Mode
*Center Mode* removes the sidebar and the table of contents, and centers the page content. This mode is great for changelogs
or any page where you want to focus on the content.
```md
---
mode: "center"
---
```
## External Links
If you want the sidebar to open an external URL, you can set the `url` metadata
in any page.
```md
---
title: "Page that goes to external link"
url: "https://www.npmjs.com/package/mintlify"
---
```
## Search Engine Optimization
You can set meta tags like the image set when shared on social media by passing
them into your page's metadata. Meta tags with colons need to be wrapped in
quotes.
```md
"twitter:image": "/images/your-photo.jpg"
```
See [our SEO page](/settings/seo) for all supported meta tags.
# Quickstart
Start building modern documentation in under five minutes
## Getting Started
Welcome! Follow the instructions below to learn how to deploy, update and
supercharge your documentation with Mintlify.
### Creating the Repository
Mintlify docs are rendered from MDX files and configurations defined in our
[starter kit](https://github.com/mintlify/starter). We use GitHub to integrate
your docs with your code, and make source control effortless. Onboard through the [dashboard](https://dashboard.mintlify.com) or clone our [starter kit](https://github.com/mintlify/starter) to get started.
Install our GitHub app to ensure that your updates are automatically deployed when you push changes. You can find the installation link in the [dashboard](https://dashboard.mintlify.com/settings), on the Settings page. Upon successful installation, a check mark will appear next to the commit hash of the repository.
![GitHub Bot Verification](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/github-bot-verification.png)
If you want your docs to live alongside your code as a monorepo setup, you
can: 1. Move your docs content to your monorepo. 2. Specify the path to your
`mint.json` in the
[dashboard](https://dashboard.mintlify.com/settings/deployment/git-settings)
### Updating the Content
Mintlify enables you to easily customize the style, structure, and content of
your docs.
1. Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
2. Once git is installed, clone your docs repository using `git clone `. If you haven't set it up yet, now would be a good time to do so with these [SSH keys](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).
3. Use your favorite IDE to open the repository.
4. Install our Mintlify CLI to preview changes with `npm i -g mintlify`.
Learn more about this in our [local development guide](/development).
Learn more about how to use the web editor on our [guide](/web-editor).
Easily customize colors, logos and buttons among other configurations in our `mint.json` file. Start with these basic configurations:
```json
"name": "Your Company"
"logo": {
"light": "/logo/light.svg",
"dark": "/logo/dark.svg",
"href": "https://yourcompany.com"
},
"favicon": "/favicon.svg",
"colors": {
"primary": "#2AB673",
"light": "#55D799",
"dark": "#117866",
},
```
A full list of supported configurations can be found at [global settings](/settings/global).
Add content with simple MDX files. Initiate your pages with this template:
```md
---
title: "Page Title"
sidebarTitle: "Sidebar title (optional - if different from page title)"
description: "Subtitle (optional)"
---
```
Learn more about adding images, tables, lists, and more using the [MDX syntax](/text). We also offer a [wide array of components](/content/components).
Once ready, commit and push your changes to update your docs site. Here is a [guide](https://docs.github.com/en/get-started/using-git/pushing-commits-to-a-remote-repository#about-git-push) on how to do that. If the GitHub app is unable to successfully deploy your changes, you can manually update your docs through our [dashboard](https://dashboard.mintlify.com).
![Manual
Update](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/manual-update.png)
You can easily set up your API references using an OpenAPI document.
1. Add your `openapi.yaml` or `openapi.json` file into your docs repository or define the `openapi` field in `mint.json` with a URL.
```json
"openapi": "link-to-your-openapi-file"
```
2. Use our [scraper](/api-playground/openapi/setup#autogenerate-files-recommended) to autogenerate your OpenAPI endpoints files as:
```bash
npx @mintlify/scraping@latest openapi-file
```
3. Finally, include the generated endpoint MDX files to your `mint.json` under `navigation`.
For a complete guide on using Mintlify with OpenAPI, check out [this guide](/api-playground/openapi/setup). [This guide](/api-playground/openapi/writing-openapi) explains how to configure your API authentication methods. For manual API references definition, explore [our syntax](/api-playground/overview).
Our in-house analytics give you insights into page views, search analytics, session recordings and more. Access these on your [dashboard](https://dashboard.mintlify.com/analytics).
We also support integrations with a range of analytics providers. You can find the list of providers [here](/integrations/analytics/overview).
We provide a white-glove migration service as part of our Enterprise plan.
Interested? You can request it by [contacting us](mailto:sales@mintlify.com).
### Publishing
Integrate your docs into your website by hosting them on a custom domain. This is included in the free plan.
Navigate to your [dashboard settings](https://www.dashboard.mintlify.com/settings) to add a custom domain.
![Custom Domain](https://mintlify.s3.us-west-1.amazonaws.com/mintlify/images/custom-domain.png)
Congrats! You've set up your Mintlify Docs and it's looking amazing! Need
support or want to give some feedback? You can join our
[community](https://mintlify.com/community) or drop us an email at
[support@mintlify.com](mailto:support@mintlify.com).
# Reusable Snippets
Reusable, custom snippets to keep content in sync
One of the core principles of software development is DRY (Don't Repeat
Yourself), which applies to documentation as
well. If you find yourself repeating the same content in multiple places, you
should create a custom snippet to keep your content in sync.
## Creating a custom snippet
**Pre-condition**: You must create your snippet file in the `snippets` directory in order for the import to work.
Any page in the `snippets` directory will be treated as a snippet and will not
be rendered into a standalone page. If you want to create a standalone page
from the snippet, import the snippet into another file and call it as a
component.
### Default export
1. Add content to your snippet file that you want to re-use. Optionally, you can add variables that can be filled in via props
when you import the snippet. In this example, our variable is word.
```typescript snippets/my-snippet.mdx
Hello world! This is my content I want to reuse across pages.
```
2. Import the snippet into your destination file.
```typescript destination-file.mdx
---
title: My title
description: My Description
---
import MySnippet from '/snippets/path/to/my-snippet.mdx';
## Header
Lorem impsum dolor sit amet.
```
### Exporting with variables
1. Optionally, you can add variables that can be filled in via props when you import the snippet. In this example, our variable is word.
```typescript snippets/my-snippet.mdx
My keyword of the day is {word}.
```
2. Import the snippet into your destination file with the variable. The property will fill in based on your specification.
```typescript destination-file.mdx
---
title: My title
description: My Description
---
import MySnippet from '/snippets/path/to/my-snippet.mdx';
## Header
Lorem impsum dolor sit amet.
```
### Reusable variables
1. Export a variable from your snippet file:
```typescript snippets/path/to/custom-variables.mdx
export const myName = 'my name';
export const myObject = { fruit: 'strawberries' };
```
2. Import the snippet from your destination file and use the variable:
```typescript destination-file.mdx
---
title: My title
description: My Description
---
import { myName, myObject } from '/snippets/path/to/custom-variables.mdx';
Hello, my name is {myName} and I like {myObject.fruit}.
```
### Reusable components
1. Inside your snippet file, create a component that takes in props by exporting
your component in the form of an arrow function.
```typescript snippets/custom-component.mdx
export const MyComponent = ({ title }) => (
{title}
... snippet content ...
);
```
MDX does not compile inside the body of an arrow function. Stick to HTML
syntax when you can or use a default export if you need to use MDX.
2. Import the snippet into your destination file and pass in the props
```typescript destination-file.mdx
---
title: My title
description: My Description
---
import { MyComponent } from '/snippets/custom-component.mdx';
Lorem ipsum dolor sit amet.
```
### Client-Side Content
By default, Mintlify employs server-side rendering, generating content
at build time. For client-side content loading, ensure to verify the
`document` object's availability before initiating the rendering process.
```typescript snippets/client-component.mdx
{/* `setTimeout` simulates a React.useEffect, which is called after the component is mounted. */}
export const ClientComponent = () => {
if (typeof document === "undefined") {
return null;
} else {
setTimeout(() => {
const clientComponent = document.getElementById("client-component");
if (clientComponent) {
clientComponent.innerHTML = "Hello, client-side component!";
}
}, 1);
return
}
}
```
# Editor Permissions
Allow more members of your team to update your docs
The team member who created your initial docs will have update access to your docs, as long as they push to your documentation repo with the same GitHub account that was used while signing up for Mintlify.
If another editor attempts to update the docs while on the free plan, you will see a warning in your git commit check.
In the details of the git check warning, you'll find the link to upgrade your plan. You can also upgrade your plan on the [dashboard](https://dashboard.mintlify.com) to enable unlimited editors to update your docs. Once you upgrade your plan, trigger a manual update or push another change to deploy your updates.
Learn more about our pricing [here](https://mintlify.com/pricing).
# Authentication
Guarantee privacy of your docs by authenticating users
Authentication offers full privacy for all of your
documentation content by requiring users to authenticate before viewing any content, such as:
* Documentation page content
* Images used in documentation pages
* Search results
* AI chat interactions
You can authenticate users through handshake methods such as:
* [Password](./authentication-setup/password)
* [JWT](./authentication-setup/jwt)
* [OAuth](./authentication-setup/oauth)
* [Mintlify dashboard](./authentication-setup/mintlify)
Authentication is similar to our [Personalization](./personalization) offering, but with guaranteed privacy. In addition
to securing your documentation content, all features that are available via
Personalization are also available via Authentication.
Check out our docs for more info on [choosing Authentication vs Personalization](./authentication-vs-personalization).
# Choosing a Handshake
How to decide which Handshake method is right for your docs
This is the documentation for **Authentication** Handshake methods. Personalization offers a [different set of Handshake methods](/settings/authentication-personalization/personalization-setup/choosing-a-handshake).
Before your users can access personalized content, they must be authenticated. Mintlify supports four Authentication Handshake methods:
1. **Password**: Configure a set of global passwords for your documentation site.
2. **JWT**: Use your own login flow to authenticate your users via a JWT in the URL.
3. **OAuth 2.0**: Integrate with your OAuth server to enable user login via the standard Authorization Code flow.
4. **Mintlify Dashboard**: Allow all of your dashboard users to access your docs, zero configuration required.
## Prerequisites
* Your security requirements allow for password sharing between documentation readers.
* You have some existing login flow.
* You can add a final step in this login flow that creates a JWT and redirects to the docs.
* You have an existing OAuth server that supports the Authorization Code flow.
* You can create a new API endpoint that can be accessed by the returned OAuth access token.
* Your documentation readers are also your documentation editors.
## Pros & Cons
Pros:
* Super simple setup
* No configuration required for adding new users - just share the password
Cons:
* Difficult to revoke access to your docs without resetting the password
* Lose personalization features, as there is no way to differentiate users with the same password
Pros:
* Reduced risk of API endpoint abuse
* Zero CORS configuration
* No restrictions on API URLs
Cons:
* Must be able to hook into your existing login flow
Pros:
* Heightened security standard
Cons:
* Requires significant work if setting up OAuth server for the first time
* Might be overkill for some applications
Pros:
* Zero-config setup
Cons:
* Requires all docs readers to have an account in your Mintlify dashboard
# JWT Handshake
Use a customized login flow to authenticate users
This is the documentation for the JWT **Authentication** Handshake. The steps for setting up the [JWT **Personalization** Handshake](/settings/authentication-personalization/personalization-setup/jwt) are slightly different.
If you don’t have a dashboard, or if you want to keep your dashboard and docs completely separate, you can use your own login flow to authenticate users via a JWT in the URL.
## Implementation
Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and generate a private key. Store this key somewhere secure where it can be accessed by your backend.
Create a login flow that does the following:
* Authenticate the user
* Create a JWT containing the authenticated user's info in the [User](../sending-data) format
* Sign the JWT with the secret key, using the EdDSA algorithm
* Create a redirect URL back to the `/login/jwt-callback` path of your docs, including the JWT as the hash
Return to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and add the login URL to your Authentication settings.
## Example
I want to set up authentication for my docs hosted at `docs.foo.com`. I want my docs
to be completely separate from my dashboard (or I don’t have a dashboard at all).
To set up authentication with Mintlify, I go to my Mintlify dashboard and generate a
JWT secret. I create a web URL `https://foo.com/docs-login` that initiates a login flow
for my users. At the end of this login flow, once I have verified the identity of the user,
I create a JWT containing the user’s custom data according to Mintlify’s specification.
I use a JWT library to sign this JWT with my Mintlify secret, create a redirect URL of the
form `https://docs.foo.com/login/jwt-callback#{SIGNED_JWT}`, and redirect the user.
I then go to the Mintlify dashboard settings and enter `https://foo.com/docs-login` for the
Login URL field.
Here's what the code might look like:
```ts TypeScript
import * as jose from 'jose';
import { Request, Response } from 'express';
const TWO_WEEKS_IN_MS = 1000 * 60 * 60 * 24 * 7 * 2;
const signingKey = await jose.importPKCS8(process.env.MINTLIFY_PRIVATE_KEY, 'EdDSA');
export async function handleRequest(req: Request, res: Response) {
const user = {
expiresAt: Math.floor((Date.now() + TWO_WEEKS_IN_MS) / 1000), // 2 week session expiration
groups: res.locals.user.groups,
content: {
firstName: res.locals.user.firstName,
lastName: res.locals.user.lastName,
},
};
const jwt = await new jose.SignJWT(user)
.setProtectedHeader({ alg: 'EdDSA' })
.setExpirationTime('10 s') // 10 second JWT expiration
.sign(signingKey);
return res.redirect(`https://docs.foo.com/login/jwt-callback#${jwt}`);
}
```
```python Python
import jwt # pyjwt
import os
from datetime import datetime, timedelta
from fastapi.responses import RedirectResponse
private_key = os.getenv(MINTLIFY_JWT_PEM_SECRET_NAME, '')
@router.get('/auth')
async def return_mintlify_auth_status(current_user):
jwt_token = jwt.encode(
payload={
'exp': int((datetime.now() + timedelta(seconds=10)).timestamp()), # 10 second JWT expiration
'expiresAt': int((datetime.now() + timedelta(weeks=2)).timestamp()), # 1 week session expiration
'groups': ['admin'] if current_user.is_admin else [],
'content': {
'firstName': current_user.first_name,
'lastName': current_user.last_name,
},
},
key=private_key,
algorithm='EdDSA'
)
return RedirectResponse(url=f'https://docs.foo.com/login/jwt-callback#{jwt_token}', status_code=302)
```
# Mintlify Auth Handshake
Use Mintlify to authenticate users
The Mintlify Auth Handshake is available only for Authentication, *not*
Personalization.
You can use Mintlify to authenticate and manage access to your documentation. Anyone that can access your dashboard will automatically be able to see your documentation.
This handshake method also enables private preview deployments, so that only Mintlify authenticated users will be able to access your preview deployments.
Authentication is available only by request. Please{" "}
contact sales for access. After we've
enabled access, you can follow the implementation instructions.
### Example
I want to set up authentication for my docs hosted at `docs.foo.com`. I want my docs
to be internal, and the people that will be viewing my docs are the same people that
contribute to my docs.
To set up authentication with Mintlify, I can go to my [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication)
and enable Authentication with the Mintlify Auth Handshake.
I can then ensure that anyone that should be able to read the docs has been added as a user in
my [Mintlify dashboard settings](https://dashboard.mintlify.com/settings/organization/members).
## Implementation
Go to your [Mintlify dashboard
settings](https://dashboard.mintlify.com/products/authentication) and select
the Mintlify Auth Handshake.
Ensure that any users that should be able to view your documentation have
been added as users in your [Mintlify dashboard
settings](https://dashboard.mintlify.com/settings/organization/members).
# OAuth 2.0 Handshake
Integrate with your OAuth server to enable user login via the Authorization Code flow
This is the documentation for the OAuth **Authentication** Handshake. The steps for setting up the [OAuth **Personalization** Handshake](/settings/authentication-personalization/personalization-setup/oauth) are slightly different.
If you have an existing OAuth server, you can integrate with Mintlify for a seamless login experience.
## Implementation
Go to your [Mintlify authentication settings](https://dashboard.mintlify.com/products/authentication), select the OAuth option, and fill out the required fields:
* **Authorization URL**: The base URL for the authorization request, to which we will add the appropriate query parameters.
* **Client ID**: An ID for the OAuth 2.0 client to be used.
* **Scopes**: An array of scopes that will be requested.
* **Token URL**: The base URL for the token exchange request.
* **Info API URL** (optional): The endpoint that will be hit to retrieve user info. If omitted, the OAuth flow will only be used to verify identity, and the user info will be empty.
Copy the Redirect URL listed in the [Mintlify authentication settings](https://dashboard.mintlify.com/products/authentication) and add it as an authorized redirect URL for your OAuth server.
If you want to take advantage of authentication's customization features, you'll need to create an endpoint to retrieve info about your users.
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [User](../sending-data) format.
Return to your [Mintlify authentication settings](https://dashboard.mintlify.com/products/authentication) and add the Info API URL
to your OAuth configuration.
## Example
I have an existing OAuth server that supports the Authorization Code flow. I want to set up authentication for my docs hosted at `foo.com/docs`.
To set up authentication with Mintlify, I create an endpoint `api.foo.com/docs/user-info` which requires an OAuth access token with the `docs-user-info` scope, and responds with the user's custom data according to Mintlify’s specification.
I then go to the Mintlify dashboard settings, navigate to the Authentication settings, select OAuth, and enter the relevant values for the OAuth flow and Info API endpoint:
* **Authorization URL**: `https://auth.foo.com/authorization`
* **Client ID**: `ydybo4SD8PR73vzWWd6S0ObH`
* **Scopes**: `['docs-user-info']`
* **Token URL**: `https://auth.foo.com/exchange`
* **Info API URL**: `https://api.foo.com/docs/user-info`
Finally, I copy the Redirect URL displayed in the dashboard settings and add it as an authorized redirect URL in my OAuth client configuration settings.
# Password Handshake
Use a set of shared passwords to authenticate users
This is the documentation for the Password **Authentication** Handshake. The
Password Handshake is not available for Personalization.
If you don't have strict security requirements, or you don't want to manage a
database of documentation readers, you can use a set of shared passwords to
protect your docs.
Authentication is available only by request. Please{" "}
contact our sales team for access.
After we've enabled access, you can follow the implementation instructions.
## Implementation
Go to your [dashboard
settings](https://dashboard.mintlify.com/products/authentication) and create
a password.
Securely share the password with your documentation readers. That's it!
## Example
I want to set up authentication for my docs hosted at `docs.foo.com`. I don't want
to have to keep track of who can and cannot access the docs. My main use case for
authentication is to prevent competitors from snooping - password sharing is secure
enough for my team.
To set up authentication with Mintlify, I go to my Mintlify dashboard and add at
least one password. I then share that password, along with the private docs URL,
with potential customers.
# Auth vs Personalization
How to determine which product is best for you
Mintlify offers both Authentication and Personalization. For the most part, Authentication is
just Personalization + privacy. However, there are some key differences that are important to
be aware of, from most important to least:
### Security Guarantees
Authentication is a fully-fledged private documentation solution. Every aspect of your docs,
including page content, images, search results, and AI chat features, are completely inaccessible to
unauthenticated users.
Personalization, on the other hand, offers no security guarantees for your documentation content.
All page content, images, search results, and AI chat features can be accessed by the public. Even
if you are using the hidden pages feature of Personalization, a motivated attacker would still
be able to access the content of a hidden page.
### Handshake Methods
Due to the difference in security requirements for Authentication and Personalization, different
handshake methods are available for each. Both methods offer a JWT and OAuth Handshake, although
the setup steps are slightly different.
Authentication offers two additional Handshake methods:
* **Password Handshake**, which protects your website with a single configurable global password.
* **Mintlify Auth Handshake**, which will allow users to view your documentation only if they have
access to your dashboard.
Personalization offers one additional Handshake method:
* **Shared Session Handshake**, a super simple method which only requires setting up a single endpoint
that returns data for already-authenticated users.
# Partial Authentication
Authenticate users to view only certain pages
Partial Authentication allows you to authenticate users to view only certain pages.
You can authenticate users through handshake methods such as:
* [Password](./authentication-setup/password)
* [JWT](./authentication-setup/jwt)
* [OAuth](./authentication-setup/oauth)
* [Mintlify dashboard](./authentication-setup/mintlify)
Partial Authentication shares all the same features as [Authentication](./authentication), but with the ability to allow unauthenticated users to view certain pages.
By default, all pages are protected. You can specify which pages should be publicly accessible by adding the `isPublic` property to the page's frontmatter.
```mdx
---
title: "My Page"
isPublic: true
---
```
# Personalization
A list of features unlocked with Personalization
Personalization refers to a suite of features that allow you to customize your
documentation experience based on some information about the user. There are
three major features of Personalization:
* **Customize MDX content** with a user's information, such as their name, plan, or title.
* **Prefill API keys** in the API Playground for streamlined use.
* **Selectively show pages** in the navigation based on a user's groups.
## How to Use
### Customizing MDX Content
When writing content, you can use the `user` variable to access the information you have sent to your docs. Here's a simple example:
Hello, {user.name ?? 'reader'}!
```jsx
Hello, {user.name ?? 'reader'}!
```
This feature becomes even more powerful when paired with custom data about the user. Here's a real world example that allows us to give specific instructions on how to access the Personalization feature based on the customer's existing plan:
Personalization is an enterprise feature. {
user.org === undefined
? <>To access this feature, first create an account at the Mintlify dashboard.>
: user.org.plan !== 'enterprise'
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, contact our sales team.>
: <>To request this feature for your enterprise org, contact our team.>
}
```jsx
Personalization is an enterprise feature. {
user.org === undefined
? <>To access this feature, first create an account at the Mintlify dashboard.>
: user.org.plan !== 'enterprise'
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, contact our sales team.>
: <>To request this feature for your enterprise org, contact our team.>
}
```
The information in `user` is only available after a user has logged in. For
logged out users, the value of `user` will be `{}`. To prevent the page from
crashing for logged-out users, always use optional chaining on your `user`
fields, e.g. `{user.org?.plan}`
### Prefilling API Keys
If you return API Playground inputs in the user info, they will automatically be prefilled in the API Playground. Make sure the name of the field in the user info is an exact match of the name in the API Playground.
### Showing/Hiding Pages
By default, every page is visible to every user. If you want to restrict which pages are visible to your users, you can add a `groups` field in your page metadata.
When determining which pages to show to the user, Mintlify will check which groups the user belongs to.
If the user is not in any of the groups listed in the page metadata, the page will not be shown.
```md
---
title: "Managing Your Users"
description: "Adding and removing users from your organization"
groups: ["admin"]
---
```
Here's a table that displays whether a page is shown for different combinations of `groups` in User and page metadata:
| | `groups` not in User | `groups: []` in User | `groups: ['admin']` in User |
| :------------------------------ | :------------------: | :------------------: | :-------------------------: |
| `groups` not in metadata | ✅ | ✅ | ✅ |
| `groups: []` in metadata | ❌ | ❌ | ❌ |
| `groups: ['admin']` in metadata | ❌ | ❌ | ✅ |
Note that an empty array in the page metadata is interpreted as "No groups
should see this page."
# Choosing a Handshake
How to decide which Handshake method is right for your docs
This is the documentation for **Personalization** Handshake methods. Authentication offers a [different set of Handshake methods](/settings/authentication-personalization/authentication-setup/choosing-a-handshake).
Before your users can access personalized content, they must be authenticated. Mintlify supports three Personalization Handshake methods:
1. **Shared Session**: Utilize the same session token used by your dashboard to authenticate users.
2. **JWT**: Use your own login flow to send user info to your docs via a JWT in the URL.
3. **OAuth 2.0**: Integrate with your OAuth server to enable user login via the PKCE flow.
## Prerequisites
* You have a dashboard or other user portal hosted at your domain.
* Your users' session credentials are stored as cookies.
* You can create a new API endpoint at the same origin or a subdomain of your dashboard.
* If your dashboard is at `foo.com`, the **API URL** must start with `foo.com` or `*.foo.com`
* If your dashboard is at `dash.foo.com`, the **API URL** must start with `dash.foo.com` or `*.dash.foo.com`
* Your docs are hosted at the same domain as your dashboard.
* If your dashboard is at `foo.com`, your **docs** must be hosted at `foo.com` or `*.foo.com`
* If your dashboard is at `*.foo.com`, your **docs** must be hosted at `foo.com` or `*.foo.com`
* You have some existing login flow.
* You can add a final step in this login flow that creates a JWT and redirects to the docs.
* You have an existing OAuth server that supports the PKCE flow.
* You can create a new API endpoint that can be accessed by the returned OAuth access token.
## Pros & Cons
Pros:
* Users that are logged into your dashboard are automatically logged into your docs
* Your users' sessions are persistent, meaning you can refresh data without requiring additional login
* Minimal setup required
Cons:
* Your docs will make a request to your backend, which may be undesirable
* You must have a dashboard that uses session authentication
* CORS configuration is usually required
Pros:
* Reduced risk of API endpoint abuse
* Zero CORS configuration
* No restrictions on API URLs
Cons:
* Must be able to hook into your existing login flow
* Dashboard sessions and docs authentication are completely decoupled, so users will need to log in to your dashboard and your docs separately
* Every time you want to refresh user data, your users must re-login to your docs
* If your users' data changes frequently, you must require your users to log in frequently or risk having stale data in the docs
* If your users' data rarely changes, this shouldn't be a problem
Pros:
* Heightened security standard
* No restrictions on API URLs
Cons:
* Requires significant work if setting up OAuth server for the first time
* Dashboard sessions and docs authentication are completely decoupled, so users will need to log in to your dashboard and your docs separately
* Might be overkill for some applications
# JWT Handshake
Use a customized login flow to authenticate users
This is the documentation for the JWT **Personalization** Handshake. The steps for setting up the [JWT **Authentication** Handshake](/settings/authentication-personalization/authentication-setup/jwt) are slightly different.
If you don’t have a dashboard, or if you want to keep your dashboard and docs completely separate, you can use your own login flow to send user info to your docs via a JWT in the URL.
## Implementation
Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and generate a private key. Store this key somewhere secure where it can be accessed by your backend.
Create a login flow that does the following:
* Authenticate the user
* Create a JWT containing the authenticated user's info in the [User](../sending-data) format
* Sign the JWT with the secret key, using the EdDSA algorithm
* Create a redirect URL back to your docs, including the JWT as the hash
Return to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and add the login URL to your Personalization settings.
## Example
I want to set up authentication for my docs hosted at `docs.foo.com`. I want my docs
to be completely separate from my dashboard (or I don’t have a dashboard at all).
To set up authentication with Mintlify, I go to my Mintlify dashboard and generate a
JWT secret. I create a web URL `https://foo.com/docs-login` that initiates a login flow
for my users. At the end of this login flow, once I have verified the identity of the user,
I create a JWT containing the user’s custom data according to Mintlify’s specification.
I use a JWT library to sign this JWT with my Mintlify secret, create a redirect URL of the
form `https://docs.foo.com#{SIGNED_JWT}`, and redirect the user.
I then go to the Mintlify dashboard settings and enter `https://foo.com/docs-login` for the
Login URL field.
Here's what the code might look like:
```ts
import * as jose from 'jose';
import { Request, Response } from 'express';
const TWO_WEEKS_IN_MS = 1000 * 60 * 60 * 24 * 7 * 2;
const signingKey = await jose.importPKCS8(process.env.MINTLIFY_PRIVATE_KEY, 'EdDSA');
export async function handleRequest(req: Request, res: Response) {
const user = {
expiresAt: Math.floor((Date.now() + TWO_WEEKS_IN_MS) / 1000),
groups: res.locals.user.groups,
content: {
firstName: res.locals.user.firstName,
lastName: res.locals.user.lastName,
},
};
const jwt = await new jose.SignJWT(user)
.setProtectedHeader({ alg: 'EdDSA' })
.setExpirationTime('10 s')
.sign(signingKey);
return res.redirect(`https://docs.foo.com#${jwt}`);
}
```
## Preserving Anchors
Post-login, if you'd like to redirect to a specific anchor on the page, you can use the following format to create the redirect URL: `https://docs.foo.com/page#jwt={SIGNED_JWT}&anchor={ANCHOR}`.
Example:
* Original: `https://docs.foo.com/quickstart#step-one`
* Redirect: `https://docs.foo.com/quickstart#jwt={SIGNED_JWT}&anchor=step-one`
# OAuth 2.0 Handshake
Integrate with your OAuth server to enable user login via the PKCE flow
This is the documentation for the OAuth **Personalization** Handshake. The steps for setting up the [OAuth **Authentication** Handshake](/settings/authentication-personalization/authentication-setup/oauth) are slightly different.
If you have an existing OAuth server that supports the PKCE flow, you can integrate with Mintlify for a seamless login experience.
## Implementation
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [User](../sending-data) format. Take note of the scope or scopes required to access this endpoint.
Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication), select the OAuth option, and fill out the required fields:
* **Authorization URL**: The base URL for the authorization request, to which we will add the appropriate query parameters.
* **Client ID**: An ID for the OAuth 2.0 client to be used.
* **Scopes**: An array of scopes that will be requested.
* **Token URL**: The base URL for the token exchange request.
* **Info API URL**: The endpoint that will be hit to retrieve user info.
Copy the Redirect URL listed in the [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and add it as an authorized redirect URL for your OAuth server.
## Example
I have an existing OAuth server that supports the PKCE flow. I want to set up authentication for my docs hosted at `foo.com/docs`.
To set up authentication with Mintlify, I create an endpoint `api.foo.com/docs/user-info` which requires an OAuth access token with the `docs-user-info` scope, and responds with the user's custom data according to Mintlify’s specification.
I then go to the Mintlify dashboard settings, navigate to the Personalization settings, select OAuth, and enter the relevant values for the OAuth flow and Info API endpoint:
* **Authorization URL**: `https://auth.foo.com/authorization`
* **Client ID**: `ydybo4SD8PR73vzWWd6S0ObH`
* **Scopes**: `['docs-user-info']`
* **Token URL**: `https://auth.foo.com/exchange`
* **Info API URL**: `https://api.foo.com/docs/user-info`
Finally, I copy the Redirect URL displayed in the dashboard settings and add it as an authorized redirect URL in my OAuth client configuration settings.
# Shared Session Handshake
Seamlessly share user sessions between your dashboard and your docs
This is the documentation for the Shared Session **Personalization** Handshake. The Shared Session Handshake is not available for Authentication.
This method utilizes the session authentication info already stored in your user’s browser to create a seamless documentation experience.
## Implementation
Create an API endpoint that uses session authentication to identify users, and responds with a JSON payload following the [User](../sending-data) format.
If the API domain does not *exactly match* the docs domain:
* Add the docs domain to your API's `Access-Control-Allow-Origin` header (must not be `*`)
* Ensure your API’s `Access-Control-Allow-Credentials` header is `true`
These CORS options only need to be enabled on the *single endpoint* responsible for returning user information. We do not recommend enabling these options on all dashboard endpoints.
Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication) and add the API URL and your Login URL to your Personalization settings.
## Examples
### Dashboard at subdomain, docs at subdomain
I have a dashboard at `dash.foo.com`, which uses cookie-based session authentication. My dashboard API routes are hosted at `dash.foo.com/api`. I want to set up authentication for my docs hosted at `docs.foo.com`.
To set up authentication with Mintlify, I create another dashboard endpoint `dash.foo.com/api/docs/user-info` which identifies the user using session auth, and responds with their custom data according to Mintlify’s specification. I then add `https://docs.foo.com` to the `Access-Control-Allow-Origin` allow-list **for this route only**, and ensure my `Access-Control-Allow-Credentials` configuration is set to `true` **for this route only**.
I then go to the Mintlify dashboard settings and enter `https://dash.foo.com/api/docs/user-info` for the API URL field.
### Dashboard at subdomain, docs at root
I have a dashboard at `dash.foo.com`, which uses cookie-based session authentication. My dashboard API routes are hosted at `dash.foo.com/api`. I want to set up authentication for my docs hosted at `foo.com/docs`.
To set up authentication with Mintlify, I create another dashboard endpoint `dash.foo.com/api/docs/user-info` which identifies the user using session auth, and responds with their custom data according to Mintlify’s specification. I then add `https://foo.com` to the `Access-Control-Allow-Origin` allow-list **for this route only**, and ensure my `Access-Control-Allow-Credentials` configuration is set to `true` **for this route only**.
I then go to the Mintlify dashboard settings and enter `https://dash.foo.com/api/docs/user-info` for the API URL field.
### Dashboard at root, docs at root
I have a dashboard at `foo.com/dashboard`, which uses cookie-based session authentication. My dashboard API routes are hosted at `foo.com/api`. I want to set up authentication for my docs hosted at `foo.com/docs`.
To set up authentication with Mintlify, I create another dashboard endpoint `foo.com/api/docs/user-info` which identifies the user using session auth, and responds with their custom data according to Mintlify’s specification.
I then go to the Mintlify dashboard settings and enter `https://foo.com/api/docs/user-info` for the API URL field.
# Sending Data
The shape of user data you can use to personalize your docs
Depending on your Handshake method, your API will respond with either a raw JSON object or a signed JWT. The shape of the data is the same for both:
```tsx
type User = {
expiresAt?: number;
groups?: string[];
content?: Record;
apiPlaygroundInputs?: {
header?: Record;
query?: Record;
cookie?: Record;
server?: Record;
};
};
```
The time at which this information should expire, in **seconds since epoch**. If the user loads the page and the current time is after this value, the stored data will be deleted.
For JWT Handshakes: This is *not* the same as the `exp` claim of the JWT. The `exp` claim determines when a JWT should no longer be considered valid, and should be set as low as possible. In this case, it can probably be set to 10 seconds or lower. The `expiresAt` field determines when retrieved data should be considered stale, and can be anywhere from one day to several weeks.
A list of groups that the user belongs to. This will determine which pages should be shown to this user. If any of these groups is listed in the `groups` field of a page’s metadata, that page will be shown.
A bag of values that can be accessed from within MDX content using the `user` variable. For example, if you have supplied `{ firstName: 'Ronan' }` as your content field, you can use the following in your MDX: `Good morning, {user.firstName}!`
User-specific values that will be prefilled in the API playground if supplied. For example, if each of my customers makes requests at a specific subdomain, I can send `{ server: { subdomain: 'foo' } }` as my `apiPlaygroundInputs` field, and this value will be prefilled on any API page with this `subdomain` value.
The`header`, `query`, and `cookie` fields will only be prefilled if they are part of your [security scheme](https://swagger.io/docs/specification/authentication/). Creating a standard header parameter named `Authorization` is not sufficient to enable this feature. To know if a field will be prefilled, navigate to your existing docs and check if the field is in either the `Authorization` or `Server` section.
# Redirects and Broken Links
Tools to help prevent invalid links
When you change the path of a file in your docs folder, it will also change the path of the URL to that page. This may happen when restructuring your docs or changing the sidebar title.
## Broken Links
Catch broken links with our CLI. Simply [install the CLI](/development) and run the command:
```bash
mintlify broken-links
```
The CLI will identify any relative links in your docs that don't exist.
## Redirects
Set up 301 redirects by adding the `redirects` field into your `mint.json` file.
```json
"redirects": [
{
"source": "/source/path",
"destination": "/destination/path"
}
]
```
This will permanently redirect `/source/path` to `/destination/path` so that you don't lose any previous SEO for the original page.
To match a wildcard path, use `*` after a parameter. In this example, `/beta/:slug*` will match `/beta/introduction` and redirects it to `/v2/introduction`.
```json
"redirects": [
{
"source": "/beta/:slug*",
"destination": "/v2/:slug*"
}
]
```
# Custom Domain
Host your documentation at your website's custom domain
To set up your documentation on a custom domain, you'll need to set your desired custom domain in your Mintlify settings and configure your DNS settings on your domain provider.
Looking to set up a custom subdirectory like mintlify.com/docs? Find
instructions [here](/advanced/subpath/cloudflare).
## Dashboard Settings
1. Head over to your [dashboard](https://dashboard.mintlify.com)
2. Click on "Settings".
3. Click on "Custom Domain".
4. Enter your desired custom domain. For example, `docs.mintlify.com`.
## Verification with Vercel
If Vercel happens to be your domain provider, you will have to add a verification `TXT` record. This information will show on your dashboard after submitting your custom domain, as well as be emailed to you.
## Configuring your DNS
1. Proceed to your domain's DNS settings on your domain provider's website.
2. Create a new DNS entry, inputting the following values:
```
CNAME | docs | cname.vercel-dns.com.
```
If you are using Cloudflare for your DNS provider, you'll need to have the “full strict” security option enabled for the https setting.
Please [contact support](mailto:sales@mintlify.com) if you don't see the custom domain set up after the above configuration.
# GitHub
Sync your docs with a GitHub repo
Mintlify integrates with the GitHub API, enabling synchronization between your
docs and your GitHub repository. This integration is made possible through the
utilization of
[GitHub Apps](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps#about-github-apps).
## Installation
To begin, you need to install the Mintlify GitHub App into the GitHub account
where your docs repo resides. Installing a GitHub App requires either
organization ownership or admin permissions in a repository. If you lack the
necessary permissions, the repository owner will need to approve the request.
You can access the installation page by logging into the
[Mintlify dashboard](https://dashboard.mintlify.com).
For GitHub Apps, you can choose to only give permissions to a single repository.
We highly recommend you do so as we only need access to the repository where
your docs are hosted.
## Permissions
During the installation of our GitHub app, you will be prompted to grant certain
permissions:
* Read and write access to `checks`, `contents`, `deployments`, `pull requests`,
and `workflows`
These permissions are leveraged to provide a seamless experience when managing
your docs.
When you make a commit to the branch you configured as your docs deployment
branch, we fetch the contents of the files changed to update your docs. To
accomplish this we need read access to your `contents`.
When pull requests are created we create a check and preview deployment which is
why we need write access to `checks` and `deployments`.
Inside the Mintlify web editor, Mintlify works on your behalf to create branches
and pull requests which is why we need write access to `pull requests` and
`workflows`.
If you are concerned about the write permissions, the GitHub App will only
have access to the repos you give it access to *and* if you have branch
protections on it *cannot* push directly to your branches - it abides by your
branch protection rules.
## Repositories Installations
When installing our GitHub app, you will be prompted to select all repositories
or a subset of them. This selection can be changed at any time by going to the
[GitHub app settings](https://github.com/apps/mintlify/installations/new).
# GitLab
Sync your docs with a GitLab repo
We use a combination of Access tokens and Webhooks to authenticate and sync
changes between GitLab and Mintlify.
* We use Access tokens to pull information from GitLab.
* We use Webhooks so GitLab can notify Mintlify when changes are made.
* This allows Mintlify to create preview deployments when a MR is created.
## Set up the connection
Within your GitLab project, navigate to `Settings` > `General` and find the `Project ID`.
a. Navigate to `Settings` > `Access Tokens`.
b. Select `Add new token`.
1. Name the token "Mintlify".
2. If you have a private repo, you must set the role as `Maintainer`.
3. Choose `api` and `read_api` for the scopes.
c. Finally click `Create project access token` and copy the token.
Within the [Mintlify dashboard](https://dashboard.mintlify.com/settings/deployment/git-settings), add the project ID and access token from the previous steps alongside the other configurations. Click "Save Changes" when you're done.
## Create the webhook
Webhooks allow us to receive events when changes are made so that we can
automatically trigger deployments.
In the "URL" field, enter the endpoint `https://leaves.mintlify.com/gitlab-webhook` and name the webhook "Mintlify".
Paste the Webhook token generated after setting up the connection.
Select the events you want to trigger the webhook:
* Push events (All branches)
* Merge requests events
When you're done it should look like this:
After creating the Webhook, click the "Test" dropdown and select "Push events" to send a sample payload to ensure it's configured correctly. It'll say "Hook executed successfully: HTTP 200" if configured correctly.
This will help you verify that everything is working correctly and that your documentation will sync properly with your GitLab repository.
Reach out to the Mintlify team if you need help. Contact us
[here](https://mintlify.com/enterprise).
[git-settings]: https://dashboard.mintlify.com/settings/deployment/git-settings
# Global Settings
Customize your documentation using the mint.json file
Every Mintlify site needs a `mint.json` file with the core configuration
settings. Learn more about the [properties](#properties) or from an
[example](#example-mint-json)
## Properties
### Styling
Name of your company or project. Used for the global title.
Path to logo image or object with path to "light" and "dark" mode logo images,
and where the logo links to. SVG format is recommended. It does not pixelate
and the file size is generally smaller.
Path to the logo in light mode. For example: `/path/to/logo.svg`
Path to the logo in dark mode. For example: `/path/to/logo.svg`
Where clicking on the logo links you to
Path to the favicon image. For example: `/path/to/favicon.svg`
Hex color codes for your global theme
The primary color. Used most often for highlighted content, section
headers, accents, in light mode
The primary color for dark mode. Used most often for highlighted content,
section headers, accents, in dark mode
The primary color for important buttons
The color of the background in both light and dark mode
The hex color code of the background in light mode
The hex color code of the background in dark mode
A preset theme configuration that changes the look and feel of the project. A
theme is a set of default styling configurations. Examples:
[Venus](https://starter-venus.mintlify.app),
[Quill](https://starter-quill.mintlify.app),
[Prism](https://starter-prism.mintlify.app)
The global layout style of the documentation.
Set a decorative background.
The style of the decorative background.
Set a custom background image to be displayed behind every page.
Custom fonts. Apply globally or set different fonts for headings and the body
text.
Example:
```json
"font": {
"headings": {
"family": "Roboto"
},
"body": {
"family": "Oswald"
}
}
```
The font family name. Custom fonts and all [Google
Fonts](https://fonts.google.com/) are supported. e.g. "Open Sans",
"Playfair Display"
The font weight. Precise values such as `560` are also supported for
variable fonts. Check under the Styles section for your Google Font for
the available weights.
The URL to the font file. Can be used to specify a font that is not from
Google Fonts.
The font format. Required if using a custom font source (`url`).
Customize the dark mode toggle.
Set if you always want to show light or dark mode for new users. When not
set, we default to the same mode as the user's operating system.
Set to true to hide the dark/light mode toggle. You can combine `isHidden` with `default` to force your docs to only use light or dark mode. For example:
```json Only Dark Mode
"modeToggle": {
"default": "dark",
"isHidden": true
}
```
```json Only Light Mode
"modeToggle": {
"default": "light",
"isHidden": true
}
```
Customize the styling of components within the sidebar.
The styling of the navigation item.
Styling configurations for the topbar.
The styling of the navigation item.
The location options for the search bar.
The location of the search bar.
The style of the rounded edges.
The style of the code block.
`auto` will automatically switch between light and dark mode based on the
user's system preferences.
### Structure
An array of groups with all the pages within that group
The name of the group.
The relative paths to the markdown files that will serve as pages. Note: groups are recursive, so to add a sub-folder add another group object in the page array.
The [Fontawesome](https://fontawesome.com/icons) icon for the group. Note: this only applies to sub-folders.
The type of [Fontawesome](https://fontawesome.com/icons) icon. Must be one of: brands, duotone, light, sharp-solid, solid, thin
Array of names and urls of links you want to include in the topbar
The name of the button.
The url once you click on the button. Example: `https://mintlify.com/contact`
Link shows a button. GitHub shows the repo information at the url provided
including the number of GitHub stars.
If type is a link: What the button links to. If type is a github: Link to
the repository to load GitHub information from.
Text inside the button. Only required if type is a link.
The style of the button.
Whether to display the arrow
Array of version names. Only use this if you want to show different versions
of docs with a dropdown in the navigation bar.
Versions can be leveraged for localization. You can store translated content
under a version, and once you specify the `locale` any fixed text in Mintlify,
such as 'Was this page helpful?', will automatically be translated based on the
locale. We currently support localization in English, Chinese, Spanish, French,
Japanese, and Portuguese.
Localization auto-translates the UI and fixed assets in the docs, such as "Was
this page helpful?". You must translate the content of the pages yourself.
For more information, please refer to our
[versioning & localization documentation](/settings/versioning).
Example:
```json Default
"versions": ["v1.0", "v1.1"]
```
```json Localization
"versions": [
{
"name": "English",
"locale": "en",
},
{
"name": "Español",
"locale": "es"
}
]
```
The version name.
The locale of the version. Supported locales are `en`, `cn`, `es`, `fr`, `jp`, `pt`, `pt-BR`, `de`.
Whether the version is the default version. Handy for when you have a "latest" and "stable" version and you want to default to the stable version.
An array of the anchors, includes the icon, color, and url.
{" "}
{" "}
The name of the anchor label.
Example: `Community`
The [Font Awesome](https://fontawesome.com/search?q=heart) icon used to feature the anchor.
Example: `comments`
The start of the URL that marks what pages go in the anchor. Generally, this is the name of the folder you put your pages in.
The hex color of the anchor icon background. Can also be a gradient if you pass an object with the properties `from` and `to` that are each a hex color.
Used if you want to hide an anchor until the correct docs version is selected.
Pass `true` if you want to hide the anchor until you directly link someone to docs inside it.
One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin"
Override the default configurations for the top-most anchor. Note: if you have
tabs configured, this does not apply.
The name of the top-most anchor
Font Awesome icon.
One of: "brands", "duotone", "light", "sharp-solid", "solid", or "thin"
An array of navigational tabs.
Example:
```json
"tabs": [
{
"name": "Writing Content",
"url": "content"
},
{
"name": "API References",
"url": "api-playground"
}
]
```
The name of the tab label.
The start of the URL that marks what pages go in the tab. Generally, this
is the name of the folder you put your pages in.
Pass `true` if you want to hide the tab until you directly link someone to docs inside it.
An object to configure the footer with socials and links.
Example:
```json
"footer": {
"socials": { "x": "https://x.com/mintlify", "website": "https://mintlify.com" },
"links": [
{
"title": "Column 1",
"links": [
{ "label": "Column 1 Link 1", "url": "https://mintlify.com" },
{ "label": "Column 1 Link 2", "url": "https://mintlify.com" }
]
},
{
"title": "Column 2",
"links": [
{ "label": "Column 2 Link 1", "url": "https://mintlify.com" },
{ "label": "Column 2 Link 2", "url": "https://mintlify.com" }
]
}
]
}
```
One of the following values `website`, `facebook`, `x`, `youtube`, `discord`, `slack`, `github`, `linkedin`, `instagram`, `hacker-news`, `medium`, `telegram`, `twitter`
Example: `x`
The URL to the social platform.
Example: `https://x.com/mintlify`
Title of the column
The link items in the column. External urls that starts with `https://` or `http://` will be opened in new tab.
Configurations to enable feedback buttons
Enables a rating system for users to indicate whether the page has been helpful
Enables a button to allow users to suggest edits via pull requests for public repositories.
If your docs repo is private, `suggestEdit` will not work.
Enables a button to allow users to raise an issue about the documentation
Configurations to change the search prompt
Set the prompt for the search bar. Default is `Search...`
### API Configurations
Configuration for API settings. Learn more about API pages at [API Components](/api-playground).
The base url for all API endpoints. If `baseUrl` is an array, it will enable for multiple base url
options that the user can toggle.
The authentication strategy used for all API endpoints.
The name of the authentication parameter used in the API playground.
If method is `basic`, the format should be `[usernameName]:[passwordName]`
The default value that's designed to be a prefix for the authentication input field.
E.g. If an `inputPrefix` of `AuthKey` would inherit the default input result of the authentication field as `AuthKey`.
Configurations for the API playground
Whether the playground is showing, hidden, or only displaying the endpoint with no added user interactivity `simple`
Learn more at the [playground guides](/api-playground)
By default, API playground requests are proxied by Mintlify. This setting can be used to disable this behavior.
Required for select request types, such as file uploads.
Configurations for API requests
Configurations for the auto-generated API request examples
An array of strings that determine the order of the languages of the auto-generated request examples. You can either define custom languages utilizing [x-codeSamples](/api-playground/openapi/advanced-features#x-codesamples) or use our default languages which include `bash`, `python`, `javascript`, `php`, `go`, `java`
Configurations for the param fields in the API Playground
The default expanded state of expandable options in the API playground.
`"all"` - every expandable component is expanded
`"topLevel"` - every top-level expandable component is expanded
`"topLevelOneOfs"` - every top-level `oneOf` type is expanded
`"none"` - every expandable component is closed (default behavior)
A string or an array of strings of URL(s) or relative path(s) pointing to your
OpenAPI file.
Examples:
```json Absolute
"openapi": "https://example.com/openapi.json"
```
```json Relative
"openapi": "/openapi.json"
```
```json Multiple
"openapi": ["https://example.com/openapi1.json", "/openapi2.json", "/openapi3.json"]
```
### Integrations
Configurations to add third-party integrations (excluding analytics integrations)
Enables Intercom widget on docs site. The value should be your Intercom App ID.
Enables Frontchat widget on docs site. The value should be your Frontchat App ID.
Configurations to add third-party analytics integrations. See full list of
supported analytics [here](/integrations/analytics/overview).
### Redirects
An array of paths you want to configure to permanently redirect to another path
Example:
```json
"redirects": [
{
"source": "/source/path",
"destination": "/destination/path"
}
]
```
The path that you want to redirect from.
Example: `/source`
The path that you want to redirect to.
Example: `/destination`
### Search Engine Optimization
Settings for Search Engine Optimization.
Example:
```json
"seo": {
"indexHiddenPages": true
}
```
Enables indexing pages not included in `navigation`.
## Example `mint.json`
Click on the following dropdown to view a sample configuration file
```json
{
"name": "Mintlify",
"logo": {
"light": "/logo/light.svg",
"dark": "/logo/dark.svg"
},
"favicon": "/favicon.svg",
"colors": {
"primary": "#16A34A",
"light": "#4ADE80",
"dark": "#166534"
},
"topbarLinks": [
{
"name": "Contact Us",
"url": "mailto:support@mintlify.com"
}
],
"topbarCtaButton": {
"name": "Get Started",
"url": "https://mintlify.com/start"
},
"anchors": [
{
"name": "API Components",
"icon": "rectangle-terminal",
"color": "#f59f0b",
"url": "api-components"
},
{
"name": "Community",
"icon": "comments",
"color": "#2564eb",
"url": "https://mintlify.com/community"
}
],
"navigation": [
{
"group": "Getting Started",
"pages": ["introduction", "quickstart"]
},
{
"group": "API Components",
"pages": ["api-playground/overview", "api-playground/configuration"]
},
{
"group": "Settings",
"pages": ["settings/global", "settings/page"]
},
{
"group": "Analytics",
"pages": ["analytics/posthog"]
}
],
"footerSocials": {
"github": "https://github.com/mintlify",
"slack": "https://mintlify.com/community",
"x": "https://x.com/mintlify"
},
"integrations": {
"intercom": "APP_ID",
"frontchat": "CHAT_ID"
}
}
```
## More Customization
Learn more about how to further customize your docs with custom CSS and JS in
[Custom Scripts](https://mintlify.com/docs/advanced/custom/).
# Navigation
Organize your docs directory to guide your users to the information they need
## Tabs
Tabs help distinguish between different topics or sections of your
documentation. They show up above the main sidebar.
Configure tabs with the `tabs` field of the `mint.json` file. The `url` field of
the tab object should map to a folder of content added to your sidebar, or an
external link.
```json
"tabs": [
{
"name": "API References",
"url": "api-references"
},
{
"name": "Content",
"url": "content"
},
{
"name": "Blog",
"url": "https://your-website.com/blog"
}
]
```
To configure the default `Documentation` primary tab, add the `primaryTab` field
to your `mint.json` file with your desired name. Any files in your navigation
not in a folder reserved by another tab will show up in the primary tab.
```json
"primaryTab": {
"name": "Home"
}
```
## Anchors
Anchors provide another way to direct users to sections of your documentation,
or link out to external URLs.
Configure anchors with the `anchors` field of the `mint.json` file. The `url`
field of the tab object should map an external link, or a folder of content
added to your sidebar. More fields for anchors can be found
[here](/settings/global).
```json
"anchors": [
{
"name": "API References",
"icon": "code",
"url": "api-references"
},
{
"name": "Content",
"icon": "pencil",
"url": "content"
},
{
"name": "Contact us",
"icon": "envelope",
"url": "https://mintlify.com/contact-us"
}
]
```
To configure the default `Documentation` top anchor, add the `topAnchor` field
to your `mint.json`.
```json
"topAnchor": {
"name": "Home",
"icon": "building"
}
```
## Sidebar
Organize your navigation by defining the `navigation` property in your
mint.json, You don't need to include `.mdx` in page names. For sidebar styling options, see the [global settings page](/settings/global#param-sidebar)
Once you add a page to your docs directory, you'll need to add the path to
`mint.json` to add it to the sidebar. Pages do not show up automatically.
```json Regular Navigation
"navigation": [
{
"group": "Getting Started",
"pages": ["quickstart"]
}
]
```
### Groups
Create groups by recursively nesting a group within a group.
```json Nested Navigation
"navigation": [
{
"group": "Getting Started",
"pages": [
"quickstart",
{
"group": "Nested Reference Pages",
"pages": ["nested-reference-page"]
}
]
}
]
```
### Folders
Simply put your MDX files in folders and update the paths in `mint.json`.
For example, to have a page at `https://yoursite.com/your-folder/your-page` you
would make a folder called `your-folder` containing an MDX file called
`your-page.mdx`.
You cannot use `api` for the name of a folder unless you nest it inside
another folder. Mintlify uses Next.js which reserves the top-level `api`
folder for internal server calls. We recommend using the folder name
`api-reference` instead.
```json Navigation With Folder
"navigation": [
{
"group": "Group Name",
"pages": ["your-folder/your-page"]
}
]
```
```json Nested Navigation
"navigation": [
{
"group": "Getting Started",
"pages": [
"quickstart",
{
"group": "Nested Reference Pages",
"pages": ["nested-reference-page"]
}
]
}
]
```
### Hidden Pages
MDX files not included in `mint.json` will not show up in the sidebar but are
accessible by linking directly to them.
Hidden pages are not indexed for search within your docs by default. If you
would like to override this behavior, you can set the
[`seo.indexHiddenPages`](/settings/global#search-engine-optimization) attribute
in your `mint.json` to `true`.
## Topbar
### Links
Add links to the topbar with the `topbarLinks` field in the `mint.json` file.
The `topbarLinks` field supports the following fields: `name`, `url`.
```json
"topbarLinks": [
{
"name": "Community",
"url": "https://mintlify.com/community"
}
]
```
### CTA Button
Customize the call-to-action (CTA) button in the topbar using the `topbarCtaButton`
field.
The `topbarCtaButton` field supports the following fields: `name`, `url`, `type`, `style`, and `arrow`. For more information on the options for these fields, see the [mint.json schema](/settings/global#structure).
```json
"topbarCtaButton": {
"name": "Get Started",
"url": "https://mintlify.com/get-started"
}
```
#### GitHub
You can also configure the CTA button to link directly to your GitHub
repository. Use the `topbarCtaButton` field with the `type` set to `github`.
```json
"topbarCtaButton": {
"type": "github",
"url": "https://github.com/mintlify/docs"
}
```
# Preview Deployments
Preview changes to your docs in a live deployment
Preview Deployments are available on the Growth and Enterprise plans. Please{" "}
contact sales for more information.
Preview Deployments allow you to preview changes to your docs in a live deployment without merging those changes to your production branch.
If you have created a pull or merge request when using Git, the generated preview URL will be available as a comment from the Mintlify bot in the PR. This URL will always reflect the latest deployment changes.
## Sharing Preview Deployments
After generating a preview URL, you can share that link with anybody for them to view.
### Authenticated Preview Deployments
If you'd like to restrict access to your Preview Deployments, you can set up preview deployment authentication. When using this authentication method, only Mintlify authenticated users will be able to access your Preview Deployments.
To set up preview deployment authentication, please [contact sales](mailto:sales@mintlify.com).
# SEO
Mintlify automatically generates most meta tags. If you want to customize them, you can set default values in mint.json or change them per page.
* og:site\_name
* og:title
* og:description
* og:url
* og:image
* og:locale
* og:logo
* article:publisher
* twitter:title
* twitter:description
* twitter:url
* twitter:image
* twitter:site
* og:image:width
* og:image:height
* robots
## Default meta tags
You can set default meta tags by adding the `metadata` field to your `mint.json`.
```json
"metadata": {
"og:image": "link to your default meta tag image"
}
```
## Changing meta tags on one page
Add your meta tags to the page's metadata like so:
```md
---
title: 'Your Example Page Title'
'og:image': 'link to your meta tag image'
---
```
Meta tags with colons need to be typed with quotes around them when you put them in the page metadata.
## Sitemaps
Mintlify automatically generates a `sitemap.xml` file and a `robots.txt` file. Simply add `/sitemap.xml` to the end of your website URL to see your sitemap. We recommend submitting the sitemap to search engines for improved SEO.
Only pages included in your `mint.json` are included by default. To include hidden links, add `seo.indexHiddenPages` to your `mint.json`:
```json
"seo": {
"indexHiddenPages": true
}
```
## Disabling indexing
If you want to stop a page from being indexed by search engines, you can include the following in the [frontmatter](/page) of your page:
```
---
noindex: true
---
```
You can also specify `noindex` for all pages in your docs by setting the `metadata.robots` field to `"noindex"` in your `mint.json`:
```json
"metadata": {
"robots": "noindex"
}
```
# Versioning & Localization
Build separate versions or localizations
Mintlify supports versioning or localization. You can use one or the other, not both.
These guides will assume `v1` pages are in a folder named `v1`, `v2` pages are in a folder named `v2`, and so on. While this method of structuring your files isn't strictly necessary, it's a great way to keep your files organized.
## Versioning
### Setup
Add `"versions": ["v2", "v1"]` to your `mint.json` file where `v1` and `v2` are the names of your versions. You can put any number of versions in this array. The first version from the array serves as the default version.
If you would like to specify a default version, you can do so like this:
```json
"versions": [
{
"name": "version-name",
"default": true
}
]
```
The versions dropdown will show your versions in the order you include them in
`mint.json`.
### Versioning Groups and Pages
The best way to specify page versions is by adding a version value to a group in the navigation. When you specify the version of a group, that version is applied to all pages within that group.
You can also specify the version of a single page in the page metadata. Versions on individual pages always take precedence.
```json Groups (mint.json)
"navigation": [
{
"group": "Getting Started",
"version": "v1",
"pages": [...]
}
],
```
```yaml Pages (quickstart.mdx)
---
title: "Quickstart"
version: "v2"
---
```
While it is possible to nest versioned groups within versioned groups, it is
not recommended. If you do take this approach, the more deeply-nested version
takes precedence.
#### Versioning Tabs and Anchors
You can hide a tab or anchor based on a version. This is useful if you have links that are only relevant in one version. Importantly, this does **not** apply the version to the pages within that anchor.
In `mint.json`, simply add `version` to your tab or anchor. Tabs and anchors without a specified version are shown in every version.
```json Tabs
"tabs": [
{
"name": "API Reference V1",
"url": "v1/api-reference",
"version": "v1"
},
{
"name": "API Reference V2",
"url": "v2/api-reference",
"version": "v2"
},
{
"name": "Migrating from V1 to V2",
"url": "https://mintlify.com/changelog/v2"
},
],
```
```json Anchors
"anchors": [
{
"name": "API Reference V1",
"url": "v1/api-reference",
"version": "v1"
},
{
"name": "API Reference V2",
"url": "v2/api-reference",
"version": "v2"
},
{
"name": "Migrating from V1 to V2",
"url": "https://mintlify.com/changelog/v2",
"version": "v2"
},
],
```
#### Sharing Between Versions
Not *all* content has to be hidden though! Any content without a specified version appears in every version so you don't have to duplicate content!
When using localization with versioning, each version can have its own set of
translations. This means you can have different language versions for
different API versions, giving you full flexibility in managing both versioned
and localized content.
### Troubleshooting
Common errors and how to fix them
You likely nested a version inside of another. For example, your group had version "v1" but your page had version "v2".
We do not recommend nesting versions inside of each other because it's hard to maintain your docs later.
If you add versions to your docs and the pages disappeared from your
navigation, make sure you spelled the version the same as in your `versions`
array in `mint.json`.
## Localization
### Setup
`"versions"` in your `mint.json` can be leveraged to create different language versions by adding a `locale` value to the version. The first localization from the array serves as the default localization.
We currently support localization in English (`en`), Chinese (`cn`), Spanish (`es`), French (`fr`), Japanese (`jp`), Portuguese (`pt`), and German (`de`).
```json mint.json example
"versions": [
{
"name": "English",
"locale": "en",
},
{
"name": "French",
"locale": "fr",
},
{
"name": "Spanish",
"locale": "es"
}
]
```
The versions dropdown will show your localizations in the order you include
them in the `mint.json`.
Once setup, the rest of localization is handled by the versioning setup described above.
# Headers and Text
Text, title, and styling in standard markdown
## Titles
Best used for section headers.
```md
## Titles
```
### Subtitles
Best used for subsection headers.
```md
### Subtitles
```
Each **title** and **subtitle** creates an anchor and also shows up on the table of contents on the right.
## Text Formatting
We support most markdown formatting. Simply add `**`, `_`, or `~` around text to format it.
| Style | How to write it | Result |
| ------------- | ----------------- | ----------------- |
| Bold | `**bold**` | **bold** |
| Italic | `_italic_` | *italic* |
| Strikethrough | `~strikethrough~` | ~~strikethrough~~ |
You can combine these. For example, write `**_bold and italic_**` to get ***bold and italic*** text.
You need to use HTML to write superscript and subscript text. That is, add `` or `` around your text.
| Text Size | How to write it | Result |
| ----------- | ------------------------ | ---------------------- |
| Superscript | `superscript` | superscript |
| Subscript | `subscript` | subscript |
## Linking to Pages
You can add a link by wrapping text in `[]()`. You would write `[link to google](https://google.com)` to [link to google](https://google.com).
Links to pages in your docs need to be root-relative. Basically, you should include the entire folder path. For example, `[link to text](/content/text)` links to the page "Text" in our components section.
Relative links like `[link to text](../text)` will open slower because we cannot optimize them as easily.
You can validate broken links in your docs with [our CLI](/development).
## Blockquotes
### Singleline
To create a blockquote, add a `>` in front of a paragraph.
> Dorothy followed her through many of the beautiful rooms in her castle.
```md
> Dorothy followed her through many of the beautiful rooms in her castle.
```
### Multiline
> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
```md
> Dorothy followed her through many of the beautiful rooms in her castle.
>
> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
```
### LaTeX
Mintlify supports in-line [LaTeX](https://www.latex-project.org) by surrounding your LaTeX code with dollar signs (\$). For example, `$(a^2 + b^2 = c^2)$` will render as $(a^2 + b^2 = c^2)$.
Equations on their own line can be created with double dollar signs (\$\$):
$\exists \, x \notin [0,1]$
```md
$$\exists \, x \notin [0,1]$$
```
### Line Breaks
Markdown syntax also recognizes a double enter in your MDX as a linebreak.
```html
```
```md
Paragraph 1
Paragraph 2
```
# Web Editor
Edit your docs directly from the dashboard with live previews.
Web Editor is the preferred way to edit docs directly without having to open your IDE or run `mintlify dev`.
The editor includes a few key features to integrate directly into your existing git workflow,
like creating branches, pull requests, commits, and diffs for your current changes.
It also includes a fully editable experience for changing and adding content directly,
even with custom components.
If you understand git workflows and our integrations already, you can skip to [here](#editing-content).
## Git and update workflows
### Git basics
While Web Editor means you don't need to go to GitHub or your command line to make
changes, it's still helpful to know the basics of git.
Git terminology:
* **Repository**: The folder in which your code lives. It can be local (on your computer) or remote (like GitHub).
* **Commit**: A snapshot of changes made to files in the repository.
* **Branch**: A separate line of development. It's a working copy of the code that allows you to work on changes without affecting the main version.
* **Pull request:** A request to merge changes from a working branch into the main branch. This is used for reviewing content before making changes live.
### Making updates
In order to make updates to your docs, we include a few buttons specifically to
integrate with your git workflow.
If you haven't done so already, please install the Mintlify GitHub app to your GitHub account.
You can find [documentation here](#1-deploying-your-docs-repository), or you can install
the app in the [GitHub App page](https://dashboard.mintlify.com/settings/organization/github-app)
page of the dashboard.
In order to make changes to your docs, you might want to change from the main branch
to avoid publishing directly to your main docs site.
To do this, you can open the branches modal on the top left of the editor.
From here, you can either switch to a different git branch than `main`, or you can
create a new branch by clicking the **"New Branch"** button.
After you create a new branch, you'll automatically be switched, and all changes
you make will be made to this new branch until you change branches again or reload the page.
By default, when you load the page again, you'll default to the main branch.
As a best practice, you should always create a new branch to make changes so you can submit a pull request for review by other teammates. You also may not have permissions to make changes to the main branch, in which case we'll try to open a pull request for you.
In order to make a commit, you have two options, both of which appear on the top
right of the editor:
If you're on the main branch of your docs repository, you can push a commit
directly to the repo by clicking the **"Publish"** button. You'll see your changes
reflect in your git branch the next time you run `git pull`.
If you're not on the main branch, you can push a commit to your branch by clicking
on the **"Save Changes"** button. If you're ready to publish a pull request to put your branch
up for review, you can click the **"Publish Pull Request"** button.
This will create the pull request for you on GitHub using the branch you selected onto
your main branch.
If you do put your pull request up for review, you can edit the title and description
of the PR, but a default Mintlify title will be provided for you if you leave it
empty.
## Editing content
### Slash commands
The easiest way to add content in the editor is by using **"Slash commands"**, which are
commands you have access to after typing `/` in the **"Visual Editor"** mode:
As you type, you'll see more options pop up:
#### Content blocks
Here are the types of content blocks available to add in the **"Visual Editor"**:
ParagraphHeadingsBullet ListNumbered ListTableImageBlockquoteCalloutsAccordionsAccordion GroupCardsCard GroupCode BlockCode GroupTabsStepsFramesUpdate
### Adding images
You can add images to your page by typing `/image` and either clicking on the **"Image"**
option or hitting ↓ + Enter on the **"Image"** option.
This will open up the image modal where you have the option to either upload a new
image or use an existing image from the repo.
Uploading an image can be done through the modal:
And you can preview an existing image before you add it.
### Editing images
In order to edit images, you just have to hover over the image to see the **"Delete"**
and **"Edit"** buttons on the top right of the image.
Clicking the **"Edit"** button lets you edit the attributes of the image.
If you want to update the source of an image to be a new image that you haven't yet
uploaded, you have to first delete the image you're changing, and then add a new one
using the [instructions above](#adding-images).
## Editor modes
In order to offer the most flexibility, the editor has three modes:
### Visual Editor
The **"Visual Editor"** is the typical WYSIWYG mode you'd see in something like Notion.
It offers you a view into your docs in a fully editable way that reflects what the final
page would look like on your main docs site.
### Source Editor
The **"Source Editor"** offers you a way to edit your MDX files in code, the same way
you'd do in your IDE. This offers less flexibility, in that our components aren't available
for auto-complete, but it does have two unique advantages.
1. It allows you to edit props of components (see our [limitations below](#current-limitations))
which is currently not available in **"Visual Editor"** mode yet.
2. It allows you to correct syntax errors which might've appeared in your repo that
might not be compatible with **"Visual Editor"** mode until you've fixed them.
### Diff View
The **"Diff View"** is a way to view the changes made to a specific document before
committing it to your repository.
This will help you see changes you've made along with formatting changes made by
the editor.
## Current limitations
We do have a few current limitations in the editor that we're working to resolve.
You currently cannot live-update your navigation based on added/edited files. You
still have to manually edit renamed, added, and deleted files in your `mint.json`
We currently don't show any previews for custom snippets. This is on our roadmap to support
as fully editable components.
We currently don't show any previews for OpenAPI specs. This is on our roadmap to support
as a read-only preview.
## Feedback
If you have any bug reports, feature requests, or other general feedback, we'd love to hear
where we can improve.
Email us at [support@mintlify.com](mailto:support@mintlify.com)