### Install Dependencies and Start Dev Server
Source: https://www.mintlify.com/docs/guides/custom-frontend
After cloning your repository and setting up environment variables, install project dependencies using npm and start the local development server to preview your site.
```bash
cd path/to/your-repository
npm install
npm run dev
```
--------------------------------
### Clone the Example Repository
Source: https://www.mintlify.com/docs/guides/assistant-embed
Clone the official example repository to get started. Navigate into the cloned directory.
```bash
git clone https://github.com/mintlify/assistant-embed-example.git
cd assistant-embed-example
```
--------------------------------
### How-to Guide Template
Source: https://www.mintlify.com/docs/guides/content-templates
Use this template for goal-driven guides that help users accomplish specific tasks, assuming some product familiarity. It includes sections for prerequisites, step-by-step instructions, code examples, tips, verification, and troubleshooting.
```mdx
---
title: "[Titles should start with a verb]"
description: "[Do specific task] to [achieve outcome]."
---
Start with a brief statement of what this guide helps users accomplish.
## Prerequisites (optional)
List only what's necessary:
- Required setup or configuration
- Permissions needed
- Related features that should be configured first
## [Action-oriented heading describing the task]
Provide direct instructions focused on achieving the goal.
1. Open [location] and navigate to [specific place]
2. Click [button or option]
3. Enter [required information]
4. Click [confirmation button]
```language
// Include code examples that users can copy and modify
```
Include practical tips that help users avoid common mistakes or work more efficiently.
## Verify the result (optional)
If success is ambiguous, explain how users can confirm they completed the task successfully.
## Troubleshooting (optional)
Address common issues users might encounter:
- **Problem description**: Solution or workaround
- **Another common issue**: How to resolve it
## Related tasks
Link to related how-to guides or next steps.
```
--------------------------------
### Install Skill with Prompt Component
Source: https://www.mintlify.com/docs/ai-native
Embed an installation prompt for your product's skill file using the Prompt component. This helps users get better results when using your product with AI tools.
```mdx
npx skills add https://your-docs-domain.com
```
--------------------------------
### Complete SEO and Search Configuration Example
Source: https://www.mintlify.com/docs/organize/settings-seo
An example demonstrating the integration of description, SEO, search, and metadata settings in docs.json.
```json
{
"description": "Documentation for Example Co.'s API and developer platform.",
"seo": {
"indexing": "navigable",
"metatags": {
"og:site_name": "Example Co. Docs",
"twitter:card": "summary_large_image"
}
},
"search": {
"prompt": "Search the docs..."
},
"metadata": {
"timestamp": true
}
}
```
--------------------------------
### Project Structure Example
Source: https://www.mintlify.com/docs/api-playground/overview
This example shows a basic project structure with an OpenAPI specification file.
```bash
/your-project
|- docs.json
|- openapi.json
```
--------------------------------
### Example Clearbit Configuration
Source: https://www.mintlify.com/docs/integrations/analytics/clearbit
An example of the `docs.json` configuration for Clearbit, showing where to place your public API key.
```json
{
"integrations": {
"clearbit": {
"publicApiKey": "pk_1a1882"
}
}
}
```
--------------------------------
### Advanced configuration example
Source: https://www.mintlify.com/docs/guides/content-templates
An example showcasing advanced configuration with multiple options set.
```language
// Example with multiple options configured
```
--------------------------------
### Install Mintlify CLI with yarn
Source: https://www.mintlify.com/docs/organize/settings
Install the Mintlify CLI globally using yarn.
```bash
yarn global add mint
```
--------------------------------
### Install Mintlify CLI
Source: https://www.mintlify.com/docs/quickstart
Install the Mintlify CLI globally using npm or pnpm. Ensure Node.js v20.17.0 or higher is installed.
```bash
npm i -g mint
```
```bash
pnpm add -g mint
```
--------------------------------
### Install the CLI
Source: https://www.mintlify.com/docs/assistant/use
Install the Mintlify CLI globally to use the assistant in local preview. This command is run once to set up the necessary tools.
```bash
npm i -g mint
```
--------------------------------
### Example Segment Integration in docs.json
Source: https://www.mintlify.com/docs/integrations/analytics/segment
An example configuration for the `docs.json` file showing how to set the Segment write key.
```json
"integrations": {
"segment": {
"key": "nqJxiRG15Y6M594P8Sb8ESEciU3VC2"
}
}
```
--------------------------------
### Amplitude API Key Example
Source: https://www.mintlify.com/docs/integrations/analytics/amplitude
An example of the Amplitude integration configuration in `docs.json` with a placeholder API key. Ensure you replace the example key with your valid Amplitude API key.
```json
"integrations": {
"amplitude": {
"apiKey": "76bb138bf3fbf58186XXX00000"
}
}
```
--------------------------------
### Example Prompt: Creating Code Examples
Source: https://www.mintlify.com/docs/guides/windsurf
Use this prompt to have Cascade generate a complete code example for a specific task, including error handling and realistic responses.
```text
Generate a complete code example showing error handling for this API endpoint. Use realistic data and include expected responses.
```
--------------------------------
### Install Mintlify Scraper
Source: https://www.mintlify.com/docs/migration
Install the `@mintlify/scraping` package globally to use the command-line tools for migrating documentation.
```bash
npm install @mintlify/scraping@latest -g
```
--------------------------------
### Install AI SDK
Source: https://www.mintlify.com/docs/api/assistant/create-assistant-message-v2
Install the necessary AI SDK packages using npm.
```bash
npm i ai@^6 @ai-sdk/react
```
--------------------------------
### Example showing typical usage
Source: https://www.mintlify.com/docs/guides/content-templates
This is a placeholder for a typical usage example within a parameter description. Replace 'language' with the actual programming language.
```language
// Example showing typical usage
```
--------------------------------
### Example Editor Link Usage
Source: https://www.mintlify.com/docs/editor/branching-and-publishing
An example of a specific editor link, demonstrating how to navigate to the 'quickstart.mdx' file on the 'main' branch of the 'docs' project for the 'acme' organization.
```text
https://app.mintlify.com/acme/docs/editor/main/~/guides/quickstart.mdx
```
--------------------------------
### Example PostHog Configuration
Source: https://www.mintlify.com/docs/integrations/analytics/posthog
A basic example of PostHog configuration for your `docs.json` file, using a provided API key.
```json
"integrations": {
"posthog": {
"apiKey": "phc_TXdpocbYTeZVm5VJmMzHTMrCofBQu3e0kN7HGMNGTVW"
}
}
```
--------------------------------
### Install Mintlify CLI with pnpm
Source: https://www.mintlify.com/docs/cli/install
Use this command to install the Mintlify CLI globally using pnpm.
```bash
pnpm add -g mint
```
--------------------------------
### Install Node.js and npm on Linux
Source: https://www.mintlify.com/docs/guides/cursor
Installs Node.js and npm using apt package manager and a package globally using npm.
```bash
sudo apt install nodejs npm
npm install -g package-name
```
--------------------------------
### MDX Example Support Page Structure
Source: https://www.mintlify.com/docs/guides/help-center
An example of how to structure an MDX file for a support article, including frontmatter for title and description, and markdown for content organization.
```mdx
---
title: "Fix login issues"
description: "Troubleshoot common problems signing in to your account"
---
## Reset your password
If you forgot your password, request a reset link from the login page.
1. Go to the login page.
2. Click **Forgot password**.
3. Enter your email address.
4. Check your inbox for the reset link.
## Clear browser cache
Old cached data can cause login problems. Clear your browser cache and try again.
## Check account status
If your account is suspended or deactivated, you'll see an error when logging in.
Contact support if you believe this is a mistake.
```
--------------------------------
### Install Mintlify Skill
Source: https://www.mintlify.com/docs/cli/index
Install the Mintlify skill for your AI coding tool to provide context on project structure, components, and documentation best practices.
```bash
npx skills add https://mintlify.com/docs
```
--------------------------------
### Hide a Group of Pages
Source: https://www.mintlify.com/docs/organize/hidden-pages
Set the `hidden` property to `true` for a group in `docs.json` to hide it from navigation. This example hides the 'Getting started' group while keeping 'Guides' visible.
```json
"groups": [
{
"group": "Getting started",
"hidden": true,
"pages": [
"index",
"quickstart"
]
},
{
"group": "Guides",
"pages": [
"guides/hidden-page.mdx",
"guides/hidden-groups.mdx"
]
}
]
```
--------------------------------
### Example Assistant.md Configuration
Source: https://www.mintlify.com/docs/assistant/customize
This example shows how to configure the assistant's persona, tone, product context, and terminology preferences. Place this file in the `.mintlify/` directory to ensure it is not publicly accessible.
```markdown
theme={null}
You are a helpful assistant for Acme Corp's developer platform.
## Tone
- Be concise and direct. Getting to the point helps people more than being exhaustive.
- Use technical language appropriate for software developers. Most people asking you questions are familiar with Acme's products.
## Product context
- Acme SDK v3 is the current stable release. v2 is deprecated. If people ask about v2, remind them it's deprecated but answer their questions.
- Direct billing questions to support@acme.com.
## Terminology
- Use "workspace" instead of "project" or "organization".
- Use "access token" instead of "API key".
```
--------------------------------
### Create a New Help Center Project
Source: https://www.mintlify.com/docs/guides/help-center
Use this command to quickly set up a new Mintlify project pre-configured for a help center using the starter template.
```bash
mint new your-help-center-name --template help-center-starter
```
--------------------------------
### MDX Column Sub-component Example
Source: https://www.mintlify.com/docs/components/columns
An MDX example showcasing the use of the Column sub-component for arranging installation and usage instructions.
```mdx
**Installation**
```bash
npm install my-package
```
**Usage**
```javascript
import { init } from 'my-package';
init();
```
```
--------------------------------
### Partial Wildcard Redirect Configuration
Source: https://www.mintlify.com/docs/create/redirects
Configure redirects for URL segments that start with a specific prefix using partial wildcards. This example redirects all URLs starting with `/articles/concepts-` to a single overview page.
```json
"redirects": [
{
"source": "/articles/concepts-*",
"destination": "/collections/overview"
}
]
```
--------------------------------
### Create a new Mintlify project
Source: https://www.mintlify.com/docs/cli/install
Run this command to create a new documentation project from the Mintlify starter template. If no directory is specified, the CLI will prompt for input.
```bash
mint new [directory]
```
--------------------------------
### Start local preview
Source: https://www.mintlify.com/docs/cli/preview
Navigate to your documentation directory and run `mint dev` to start a local preview. The preview will be available at `http://localhost:3000` and will reload automatically as you make changes.
```bash
mint dev
```
--------------------------------
### OpenAPI Specification Example
Source: https://www.mintlify.com/docs/api-playground/troubleshooting
A snippet of an OpenAPI YAML file defining a path for a GET request to retrieve a user.
```yaml
paths:
"/users/{id}":
get: ...
```
--------------------------------
### Example Monorepo Vale File Structure
Source: https://www.mintlify.com/docs/deploy/ci
This structure illustrates how to configure Vale for custom vocabulary in a monorepo setup, placing the configuration within a docs subdirectory.
```text
/your-monorepo
|- main.ts
|- docs/
|- docs.json
|- .vale.ini
|- styles/
|- config/
|- vocabularies/
|- Mintlify/
|- accept.txt
|- reject.txt
|- example-page.mdx
|- test/
```
--------------------------------
### Example Pull Request Instructions
Source: https://www.mintlify.com/docs/editor/settings
Configure pull request instructions to guide the AI in generating standardized titles and descriptions for pull requests. This ensures consistency for reviewers.
```text
Title: imperative mood, under 70 characters, no trailing period.
Description: include a "## Summary" section (one sentence) and a
"## Changes" section as a bulleted list. Link any referenced page
using its relative path.
```
--------------------------------
### Start Development Server
Source: https://www.mintlify.com/docs/guides/assistant-embed
Run the development server using `npm run dev`. Access your application in a browser and interact with the assistant widget.
```bash
npm run dev
```
--------------------------------
### Basic Tooltip Example
Source: https://www.mintlify.com/docs/components/tooltips
Displays a tooltip with a headline, tip text, and a call-to-action link when hovering over the text 'API'. The tooltip provides a definition and a link to the API guide.
```mdx
API documentation helps developers understand how to integrate with your service.
```
--------------------------------
### Create a New Mintlify Project
Source: https://www.mintlify.com/docs/cli/commands
Use `mint new` to initialize a new documentation project. You can specify a directory and use flags to set the project name, theme, or template. The `--force` flag overwrites existing directories without prompting.
```bash
mint new [directory] [flags]
```
--------------------------------
### Add API Endpoints to Navigation
Source: https://www.mintlify.com/docs/guides/developer-documentation
Include your API endpoints in the `docs.json` navigation to make them accessible within your documentation. Refer to the OpenAPI setup guide for advanced configuration options.
```json
{
"group": "API Reference",
"pages": [
"api-reference/overview",
"api-reference/users/list-users",
"api-reference/users/get-user",
"api-reference/users/create-user"
]
}
```
--------------------------------
### Install Mintlify Skill and MCP Servers
Source: https://www.mintlify.com/docs/agent/index
Install the Mintlify skill for project context and best practices. Add the Mintlify Docs MCP server for documentation search and the Mintlify MCP server for dashboard access and content management.
```bash
npx skills add [https://mintlify.com/docs](https://mintlify.com/docs)
```
```bash
[https://mintlify.com/docs/mcp](https://mintlify.com/docs/mcp)
```
```bash
[https://mcp.mintlify.com](https://mcp.mintlify.com)
```
--------------------------------
### Wildcard Redirect Configuration
Source: https://www.mintlify.com/docs/create/redirects
Use a wildcard `*` after a parameter in the `source` and `destination` paths to match and redirect multiple related URLs. This example redirects paths starting with `/beta/` to a new versioned path.
```json
"redirects": [
{
"source": "/beta/:slug*",
"destination": "/v2/:slug*"
}
]
```
--------------------------------
### Set Default API Key for Playground
Source: https://www.mintlify.com/docs/api-playground/openapi-setup
Use the `x-default` extension on an `apiKey` security scheme to provide a default value in the API playground. This helps users get started quickly by pre-filling authentication fields.
```json
{
"components": {
"securitySchemes": {
"apiKey": {
"type": "apiKey",
"in": "header",
"name": "X-API-Key",
"x-default": "your-api-key-here"
}
}
}
}
```
--------------------------------
### Example AGENTS.md Configuration
Source: https://www.mintlify.com/docs/agent/customize
This markdown file contains instructions for the documentation agent, covering code example standards, API documentation requirements, style guidelines, and content inclusion rules. Place this file in the `.mintlify/` directory.
```markdown
# Documentation agent instructions
## Code examples
- Use TypeScript for all code examples. Our users are primarily TypeScript developers.
- Always include error handling in API call examples.
- Show both success and error response examples for all endpoints.
- Include import statements at the top of code examples.
## API documentation standards
- Every endpoint must document: authentication requirements, rate limits, and common error codes.
- Use real-world parameter values in examples (not foo/bar placeholders).
- Include a complete request/response cycle for each endpoint.
## Style and formatting
- Write for developers with 2-5 years of experience. Don't oversimplify, but explain non-obvious concepts.
- Use active voice and second person ("you").
- Date format: ISO 8601 (YYYY-MM-DD).
- When referencing UI elements, use bold: **Settings** button.
## What to include
- Add prerequisite sections to guides when users need API keys, environment setup, or dependencies.
- Include "Next steps" sections linking to related documentation.
- Add troubleshooting sections for common issues we see in support tickets.
```
--------------------------------
### Install Dependencies with npm
Source: https://www.mintlify.com/docs/guides/cursor
Installs required packages using npm. Verify installation by running `npm list`.
```bash
npm install
```
--------------------------------
### Display Request Example in Sidebar
Source: https://www.mintlify.com/docs/components/examples
Use the RequestExample component to pin code examples in the right sidebar. This component is ideal for API documentation to show request samples alongside API details.
```bash
curl --request POST \
--url https://dog-api.kinduff.com/api/facts
```
--------------------------------
### Install Dependencies for Next.js or Vite
Source: https://www.mintlify.com/docs/guides/assistant-embed
Install project dependencies based on your chosen development tool. Use `npm install` for either Next.js or Vite.
```bash
cd nextjs
npm install
```
```bash
cd vite
npm install
```
--------------------------------
### Example Automation Procedure
Source: https://www.mintlify.com/docs/guides/use-automations
Illustrates how to write automation instructions as a step-by-step procedure for more reliable agent execution.
```text
1. Read the merged pull request diff from the trigger repository.
2. Identify any changed API endpoints, parameters, or response shapes.
3. Search the documentation for pages that reference those endpoints.
4. Update the affected pages to match the changes in the pull request.
5. Open a pull request with a summary of the pages you changed and why.
```
--------------------------------
### Example docs.json Configuration
Source: https://www.mintlify.com/docs/integrations/analytics/clarity
An example of how to configure the Microsoft Clarity integration in your `docs.json` file, replacing 'required' with your actual Clarity project ID. This shows a concrete implementation.
```json
{
"integrations": {
"clarity": {
"projectId": "abc123xyz"
}
}
}
```
--------------------------------
### Get deployment status
Source: https://www.mintlify.com/docs/llms.txt
Get the status of an update from the status ID.
```APIDOC
## GET /update/status
### Description
Get the status of an update from the status ID.
### Method
GET
### Endpoint
/update/status
### Parameters
#### Query Parameters
- **statusId** (string) - Required - The ID of the update status to retrieve.
```
--------------------------------
### Example Analytics Integration Configuration
Source: https://www.mintlify.com/docs/integrations/analytics/overview
This example shows how to configure GA4, PostHog, and Mixpanel integrations within your `docs.json` file. Ensure you replace placeholder values with your actual credentials.
```json
{
"integrations": {
"ga4": {
"measurementId": "G-XXXXXXXXXX"
},
"posthog": {
"apiKey": "phc_xxxxxxxxxxxxx",
"apiHost": "https://app.posthog.com"
},
"mixpanel": {
"projectToken": "xxxxxxxxxxxxx"
}
}
}
```
--------------------------------
### Get Update Status
Source: https://www.mintlify.com/docs/api/introduction
Get the status of an update and other details about your docs.
```APIDOC
## GET /api/update/status
### Description
Get the status of an update and other details about your docs.
### Method
GET
### Endpoint
/api/update/status
```
--------------------------------
### Basic Icon Example
Source: https://www.mintlify.com/docs/components/icons
Demonstrates the basic usage of the Icon component with an icon name and size.
```mdx
```
--------------------------------
### Example Documentation Content Structure
Source: https://www.mintlify.com/docs/guides/custom-frontend
Organize your documentation files within the `docs/` directory. This structure includes `docs.json` for site configuration and MDX files for content, with subdirectories for further organization.
```text
docs/
├── docs.json # Navigation and site configuration
├── index.mdx # MDX pages for content
├── quickstart.mdx
└── guides/ # Directories for organizing pages
├── setup.mdx
└── troubleshooting.mdx
```
--------------------------------
### Install Node.js on Windows
Source: https://www.mintlify.com/docs/guides/cursor
Installs Node.js using Chocolatey and a package globally using npm.
```powershell
choco install nodejs
npm install -g package-name
```
--------------------------------
### Create a new Mintlify project with a template and theme
Source: https://www.mintlify.com/docs/cli/install
Combine the --template and --theme flags to create a new project with a specific template and override its default theme.
```bash
mint new my-docs --template --theme
```
--------------------------------
### Install Node.js on macOS
Source: https://www.mintlify.com/docs/guides/cursor
Installs Node.js using Homebrew and a package globally using npm.
```bash
brew install node
npm install -g package-name
```
--------------------------------
### Example File Organization
Source: https://www.mintlify.com/docs/create/files
Organize your files using folders to keep your repository easy to navigate. The structure in your repository directly maps to the URL structure.
```text
/your-project
|- docs.json
|- images/
|- logo.png
|- screenshots/
|- dashboard.png
|- assets/
|- whitepaper.pdf
|- demo-video.mp4
```
--------------------------------
### Intercom Integration Example
Source: https://www.mintlify.com/docs/integrations/support/intercom
An example of the Intercom integration configuration in `docs.json` with a sample App ID.
```json
"integrations": {
"intercom": {
"appId": "abc123def4"
}
}
```