> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aihubmix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Personalization

> A list of features unlocked with Personalization

Personalization refers to a suite of features that allow you to customize your
documentation experience based on some information about the user. There are
three major features of Personalization:

* **Customize MDX content** with a user's information, such as their name, plan, or title.

* **Prefill API keys** in the API Playground for streamlined use.

* **Selectively show pages** in the navigation based on a user's groups.

## How to Use

### Customizing MDX Content

When writing content, you can use the `user` variable to access the information you have sent to your docs. Here's a simple example:

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

```jsx theme={null}
Hello, {user.name ?? 'reader'}!
```

This feature becomes even more powerful when paired with custom data about the user. Here's a real world example that allows us to give specific instructions on how to access the Personalization feature based on the customer's existing plan:

Personalization is an enterprise feature. {
user.org === undefined
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
: user.org.plan !== 'enterprise'
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:sales@mintlify.com">contact our sales team</a>.</>
: <>To request this feature for your enterprise org, <a href="mailto:sales@mintlify.com">contact our team</a>.</>
}

```jsx theme={null}
Personalization is an enterprise feature. {
  user.org === undefined
    ? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
    : user.org.plan !== 'enterprise'
      ? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:sales@mintlify.com">contact our sales team</a>.</>
      : <>To request this feature for your enterprise org, <a href="mailto:sales@mintlify.com">contact our team</a>.</>
}
```

<Note>
  The information in `user` is only available after a user has logged in. For
  logged out users, the value of `user` will be `{}`. To prevent the page from
  crashing for logged-out users, always use optional chaining on your `user`
  fields, e.g. `{user.org?.plan}`
</Note>

### Prefilling API Keys

If you return API Playground inputs in the user info, they will automatically be prefilled in the API Playground. Make sure the name of the field in the user info is an exact match of the name in the API Playground.

### Showing/Hiding Pages

By default, every page is visible to every user. If you want to restrict which pages are visible to your users, you can add a `groups` field in your page metadata.
When determining which pages to show to the user, Mintlify will check which groups the user belongs to.
If the user is not in any of the groups listed in the page metadata, the page will not be shown.

```md theme={null}
---
title: "Managing Your Users"
description: "Adding and removing users from your organization"
groups: ["admin"]
---
```

Here's a table that displays whether a page is shown for different combinations of `groups` in User and page metadata:

|                                 | `groups` not in User | `groups: []` in User | `groups: ['admin']` in User |
| :------------------------------ | :------------------: | :------------------: | :-------------------------: |
| `groups` not in metadata        |           ✅          |           ✅          |              ✅              |
| `groups: []` in metadata        |           ❌          |           ❌          |              ❌              |
| `groups: ['admin']` in metadata |           ❌          |           ❌          |              ✅              |

<Note>
  Note that an empty array in the page metadata is interpreted as "No groups
  should see this page."
</Note>
