User Auth lets you identify and authenticate users to create personalized documentation experiences.

Key Features

  1. Customize Content - Display user-specific information like names or account details
  2. Prefill API Keys - Automatically populate API playground inputs
  3. Control Access - Show/hide pages based on user groups

What isn’t User Auth

User Auth is not designed for:

  1. Private docs content - Pages remain accessible via URL even if hidden from navigation
  2. User database storage - Mintlify doesn’t store user data; it uses your existing infrastructure
For private documentation needs, contact our team.

How to Use

Customizing Content

Use the userContext variable to access user information:

Hello, {userContext.name ?? 'reader'}!

Always use optional chaining (e.g., userContext.org?.plan) since userContext is empty ({}) for logged-out users.

Prefilling API Keys

API Playground inputs are automatically prefilled when matching field names are found in the user info.

Managing Page Visibility

Control page visibility using the groups field in your page metadata:

---
title: 'Example Page'
description: 'Description'
groups: ['admin']
---

This page will only be visible to users in the ‘admin’ group.