Skip to content

Commit 45df329

Browse files
committed
revert unintended changes
1 parent e531e34 commit 45df329

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed
Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,55 @@
11
---
2-
title: 'Personalization'
3-
description: 'A list of features unlocked with Personalization'
2+
title: "Personalization"
3+
description: "A list of features unlocked with Personalization"
44
---
55

6-
<Note>
7-
Personalization is an enterprise feature. To get access, [contact sales](mailto:[email protected]).
8-
</Note>
9-
106
Personalization refers to a suite of features that allow you to customize your
117
documentation experience based on some information about the user. There are
128
three major features of Personalization:
139

14-
* **Customize MDX content** with a user's information, such as their name, plan, or title.
10+
- **Customize MDX content** with a user's information, such as their name, plan, or title.
1511

16-
* **Prefill API keys** in the API Playground for streamlined use.
12+
- **Prefill API keys** in the API Playground for streamlined use.
1713

18-
* **Selectively show pages** in the navigation based on a user's groups.
14+
- **Selectively show pages** in the navigation based on a user's groups.
1915

2016
## How to Use
2117

2218
### Customizing MDX Content
2319

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

26-
Hello, {userContext.name ?? 'reader'}!
22+
Hello, {user.name ?? 'reader'}!
2723

2824
```jsx
29-
Hello, {userContext.name ?? 'reader'}!
25+
Hello, {user.name ?? 'reader'}!
3026
```
3127
3228
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:
3329
3430
Personalization is an enterprise feature. {
35-
userContext.org === undefined
31+
user.org === undefined
3632
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
37-
: userContext.org.plan !== 'enterprise'
38-
? <>You are currently on the ${userContext.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
33+
: user.org.plan !== 'enterprise'
34+
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
3935
: <>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
4036
}
4137
4238
```jsx
4339
Personalization is an enterprise feature. {
44-
userContext.org === undefined
40+
user.org === undefined
4541
? <>To access this feature, first create an account at the <a href="https://dashboard.mintlify.com/login">Mintlify dashboard</a>.</>
46-
: userContext.org.plan !== 'enterprise'
47-
? <>You are currently on the ${userContext.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
42+
: user.org.plan !== 'enterprise'
43+
? <>You are currently on the ${user.org.plan ?? 'free'} plan. To speak to our team about upgrading, <a href="mailto:[email protected]">contact our sales team</a>.</>
4844
: <>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
4945
}
5046
```
5147
5248
<Note>
53-
The information in `userContext` is only available after a user has logged in. For logged out users, the value of `userContext` will be `{}`. To prevent the page from crashing for logged-out users, always use optional chaining on your `userContext` fields, e.g. `{userContext.org?.plan}`
49+
The information in `user` is only available after a user has logged in. For
50+
logged out users, the value of `user` will be `{}`. To prevent the page from
51+
crashing for logged-out users, always use optional chaining on your `user`
52+
fields, e.g. `{user.org?.plan}`
5453
</Note>
5554
5655
### Prefilling API Keys
@@ -65,18 +64,21 @@ If the user is not in any of the groups listed in the page metadata, the page wi
6564
6665
```md
6766
---
68-
title: 'Managing Your Users'
69-
description: 'Adding and removing users from your organization'
70-
groups: ['admin']
67+
title: "Managing Your Users"
68+
description: "Adding and removing users from your organization"
69+
groups: ["admin"]
7170
---
7271
```
7372
74-
Here's a table that displays whether a page is shown for different combinations of `groups` in UserInfo and page metadata:
73+
Here's a table that displays whether a page is shown for different combinations of `groups` in User and page metadata:
7574
76-
| | `groups` not in UserInfo | `groups: []` in UserInfo | `groups: ['admin']` in UserInfo |
77-
| :------------------------------ | :----------------------: | :----------------------: | :-----------------------------: |
78-
| `groups` not in metadata | | | |
79-
| `groups: []` in metadata | | | |
80-
| `groups: ['admin']` in metadata | | | |
75+
| | `groups` not in User | `groups: []` in User | `groups: ['admin']` in User |
76+
| :------------------------------ | :------------------: | :------------------: | :-------------------------: |
77+
| `groups` not in metadata | ✅ | ✅ | |
78+
| `groups: []` in metadata | ❌ | ❌ | |
79+
| `groups: ['admin']` in metadata | ❌ | ❌ | |
8180
82-
<Note>Note that an empty array in the page metadata is interpreted as "No groups should see this page."</Note>
81+
<Note>
82+
Note that an empty array in the page metadata is interpreted as "No groups
83+
should see this page."
84+
</Note>

0 commit comments

Comments
 (0)