You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: 'A list of features unlocked with Personalization'
2
+
title: "Personalization"
3
+
description: "A list of features unlocked with Personalization"
4
4
---
5
5
6
-
<Note>
7
-
Personalization is an enterprise feature. To get access, [contact sales](mailto:[email protected]).
8
-
</Note>
9
-
10
6
Personalization refers to a suite of features that allow you to customize your
11
7
documentation experience based on some information about the user. There are
12
8
three major features of Personalization:
13
9
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.
15
11
16
-
***Prefill API keys** in the API Playground for streamlined use.
12
+
-**Prefill API keys** in the API Playground for streamlined use.
17
13
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.
19
15
20
16
## How to Use
21
17
22
18
### Customizing MDX Content
23
19
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:
25
21
26
-
Hello, {userContext.name??'reader'}!
22
+
Hello, {user.name??'reader'}!
27
23
28
24
```jsx
29
-
Hello, {userContext.name??'reader'}!
25
+
Hello, {user.name??'reader'}!
30
26
```
31
27
32
28
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:
33
29
34
30
Personalization is an enterprise feature. {
35
-
userContext.org === undefined
31
+
user.org === undefined
36
32
? <>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>.</>
39
35
:<>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
40
36
}
41
37
42
38
```jsx
43
39
Personalization is an enterprise feature. {
44
-
userContext.org === undefined
40
+
user.org === undefined
45
41
? <>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>.</>
48
44
:<>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
49
45
}
50
46
```
51
47
52
48
<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}`
54
53
</Note>
55
54
56
55
### 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
65
64
66
65
```md
67
66
---
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"]
71
70
---
72
71
```
73
72
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:
75
74
76
-
| | `groups` not in UserInfo | `groups: []` in UserInfo | `groups: ['admin']` in UserInfo |
0 commit comments