# 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+.
## Autogenerating the API playground
You can either [autogenerate the API playground](/settings/navigation#tabs) or
create MDX files for the individual OpenAPI endpoints.
### Auto-populate API pages
You can add an `openapi` field to an object in the `tabs` or `anchors` array in
the `mint.json`. This can either be with OpenAPI documents that are in the docs
repo (json or yaml) or hosted at a link.
**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)
### Create MDX files for OpenAPI endpoints
You can also create MDX files associated with each OpenAPI endpoint if you would
like to add additional context to specific pages or have more granular control
over the navigation. Here is
[the code](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)
If you want to autogenerate MDX files for every endpoint in your OpenAPI
document you can use our scraper.
#### Autogenerate files
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. If you're using a publicly-hosted OpenAPI
document, you can supply the URL in place of a path.
```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
By using the OpenAPI reference, the name, description, parameters, responses,
and the API playground will be automatically generated using the specifications.
If you have multiple OpenAPI files, include the path to the OpenAPI file to map
the MDX file to the appropriate OpenAPI file. 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 endpoint must match the endpoint specified in the OpenAPI
specifications 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
## 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.
## 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 user auth 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.
# 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 for toggling 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
```
**Step 2**: Navigate to the docs directory (where the `mint.json` file is located) and execute the following command:
```bash
mintlify dev
```
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
```
## 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 viewer events
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
>
}
/>
}
/>
}
/>
}
/>
}
/>
}
/>
## 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"
}
}
```
# 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 `http://` or `https://` with your domain.
```json Analytics options in mint.json
"analytics": {
"plausible": {
"domain": "required"
}
}
```
```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"
---
```
## 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.
If you've created a docs repo in our onboarding, this step is complete. You can find your docs repository on your Mintlify [dashboard](https://dashboard.mintlify.com).
To create your docs repo without logging into GitHub, follow these instructions:
1. Clone our [starter template](https://github.com/mintlify/starter) into a new public repo. You can make the repo private later.
2. [Get in touch](mailto:support@mintlify.com) with our team to deploy your repo.
![Starter Template](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/starter-template.png)
The next step is to install our GitHub app. This ensures 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)
### 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 even 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). This is a principle that applies to documentation as
well. If you find yourself repeating the same content in multiple places, you
should consider creating 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.
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 across multiple
locations. Optionally, you can add variables that can be filled in via props
when you import the snippet.
```typescript snippets/my-snippet.mdx
Hello world! This is my content I want to reuse across pages. My keyword of the
day is {word}.
```
The content that you want to reuse must be inside the `snippets` directory in
order for the import to work.
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.
```
### 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).
# Single Sign-On (SSO)
Customize how your team can login to Mintlify
Mintlify supports single sign-on to your dashboard via SAML and OIDC. If you use Okta or Google Workspace, we have provider-specific documentation for setting up SSO, but if you use another provider, please contact us!
SSO functionality is available on our Enterprise plan. [Contact
us](https://mintlify.com/enterprise) to learn more!
## Okta
Under `Applications`, click to create a new app integration using SAML 2.0.
Enter the following:
* Single sign-on URL (provided by Mintlify)
* Audience URI (provided by Mintlify)
* Name ID Format: `EmailAddress`
* Attribute Statements:
| Name | Name format | Value |
| ----------- | ----------- | ---------------- |
| `firstName` | Basic | `user.firstName` |
| `lastName` | Basic | `user.lastName` |
Once the application is set up, navigate to the sign-on tab and send us the metadata URL.
We'll enable the connection from our side using this information.
Under `Applications`, click to create a new app integration using OIDC.
You should choose the `Web Application` application type.
Select the authorization code grant type and enter the Redirect URI provided by Mintlify.
Once the application is set up, navigate to the General tab and locate the client ID & client secret.
Please securely provide us with these, along with your Okta instance URL (e.g. `.okta.com`). You can send these via a service like 1Password or SendSafely.
## Google Workspace
Under `Web and mobile apps`, select `Add custom SAML app` from the `Add app` dropdown.
![](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/gsuite-add-custom-saml-app.png)
Copy the provided SSO URL, Entity ID, and x509 certificate and send it to the Mintlify team.
![](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/gsuite-saml-metadata.png)
On the Service provider details page, enter the following:
* ACS URL (provided by Mintlify)
* Entity ID (provided by Mintlify)
* Name ID format: `EMAIL`
* Name ID: `Basic Information > Primary email`
![](https://mintlify.s3-us-west-1.amazonaws.com/mintlify/images/gsuite-sp-details.png)
On the next page, enter the following attribute statements:
| Google Directory Attribute | App Attribute |
| -------------------------- | ------------- |
| `First name` | `firstName` |
| `Last name` | `lastName` |
Once this step is complete and users are assigned to the application, let our team know and we'll enable SSO for your account!
# 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 the documentation at your website's custom subdomain
To set up your documentation on a custom subdomain, you'll need to set your desired custom subdomain in your Mintlify settings and configure your DNS settings on your domain provider.
Looking to set up a custom subdirectory domain like mintlify.com/docs? Find
instructions [here](/advanced/subpath/cloudflare).
## Dashboard Settings
1. Head over to your [dashboard project](https://dashboard.mintlify.com)
2. Click on the "Add custom subdomain".
3. Enter your desired custom subdomain. 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 subdomain, as well as be emailed to you.
## Configuring your DNS
1. Proceed to your domain's DNS settings on your domain provider.
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 subdomain 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
GitLab integration is available on the [Enterprise plan](https://mintlify.com/pricing).
Navigate to your project's `Settings` > `General` and find the Project ID.
a. Navigate to your project's `Settings` > `Access Tokens`.
b. Select `Add new token`.
1. Name the token "Mintlify" - this specific name is important as it will be visible when we make changes on our end.
2. Choose `read_api` for the scopes.
3. If you have a private repo, you must set the role as `Reporter`.
c. Finally click `Create project access token` and copy the token.
Contact us [here](https://mintlify.com/enterprise).
# 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.
For more information, please refer to our
[versioning 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`.
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
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://1tc7vihvbit.typeform.com/to/pZJ31XZB"
},
"anchors": [
{
"name": "API Components",
"icon": "rectangle-terminal",
"color": "#f59f0b",
"url": "api-components"
},
{
"name": "Community",
"icon": "comments",
"color": "#2564eb",
"url": "https://discord.gg/MPNgtSZkgK"
}
],
"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.
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 `topbarCTA`
field.
The `topbarCTA` field supports the following fields: `name`, `url`, and `type`.
```json
"topbarCTA": {
"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"
}
```
# Search Engine Optimization
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
## 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
---
```
# Versioning
Build separate versions
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.
## 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.
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!
## 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`.
# Headers and Text
Text, title, and styling in standard markdown
## Titles
Best used for section headers.
```md
## Titles
```
### Subtitles
Best use to 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.
Mintlify Web Editor is currently in beta. We are in the process of adding additional
features and fixing bugs. We'd love to get your feedback on what we can improve at [support@mintlify.com](mailto:support@mintlify.com).
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.
In components like `` and `` which have props like title, icon,
href, etc., you currently cannot edit those props without going to the **"Source Editor"**
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.
There are currently some bugs around keyboard navigation that we're working to resolve.
This includes things like going back/forward and up/down between Mintlify components and normal
markdown blocks, or deleting a line vs. a Mintlify component.
## 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)