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
Copy file name to clipboardExpand all lines: settings/authentication-personalization/authentication-setup/oauth.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ If you have an existing OAuth server, you can integrate with Mintlify for a seam
26
26
</Step>
27
27
<Steptitle="Create your Info API (Optional)">
28
28
If you want to take advantage of authentication's customization features, you'll need to create an endpoint to retrieve info about your users.
29
-
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [UserInfo](../sending-data) format.
29
+
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [User](../sending-data) format.
30
30
31
31
Return to your [Mintlify authentication settings](https://dashboard.mintlify.com/products/authentication) and add the Info API URL
Copy file name to clipboardExpand all lines: settings/authentication-personalization/personalization-setup/oauth.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ If you have an existing OAuth server that supports the PKCE flow, you can integr
13
13
14
14
<Steps>
15
15
<Steptitle="Create your Info API">
16
-
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [UserInfo](../sending-data) format. Take note of the scope or scopes required to access this endpoint.
16
+
Create an API endpoint that can be accessed with an OAuth access token, and responds with a JSON payload following the [User](../sending-data) format. Take note of the scope or scopes required to access this endpoint.
17
17
</Step>
18
18
<Steptitle="Configure your Personalization settings">
19
19
Go to your [Mintlify dashboard settings](https://dashboard.mintlify.com/products/authentication), select the OAuth option, and fill out the required fields:
Copy file name to clipboardExpand all lines: settings/authentication-personalization/personalization-setup/shared-session.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This method utilizes the session authentication info already stored in your user
13
13
14
14
<Steps>
15
15
<Steptitle="Create your Info API">
16
-
Create an API endpoint that uses session authentication to identify users, and responds with a JSON payload following the [UserInfo](../sending-data) format.
16
+
Create an API endpoint that uses session authentication to identify users, and responds with a JSON payload following the [User](../sending-data) format.
17
17
18
18
If the API domain does not *exactly match* the docs domain:
19
19
- Add the docs domain to your API's `Access-Control-Allow-Origin` header (must not be `*`)
Copy file name to clipboardExpand all lines: settings/authentication-personalization/personalization.mdx
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,36 +21,36 @@ three major features of Personalization:
21
21
22
22
### Customizing MDX Content
23
23
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:
24
+
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
25
26
-
Hello, {userContext.name??'reader'}!
26
+
Hello, {user.name??'reader'}!
27
27
28
28
```jsx
29
-
Hello, {userContext.name??'reader'}!
29
+
Hello, {user.name??'reader'}!
30
30
```
31
31
32
32
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
33
34
34
Personalization is an enterprise feature. {
35
-
userContext.org === undefined
35
+
user.org === undefined
36
36
? <>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>.</>
37
+
: user.org.plan !== 'enterprise'
38
+
? <>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
39
:<>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
40
40
}
41
41
42
42
```jsx
43
43
Personalization is an enterprise feature. {
44
-
userContext.org === undefined
44
+
user.org === undefined
45
45
? <>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>.</>
46
+
: user.org.plan !== 'enterprise'
47
+
? <>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
48
:<>To request this feature for your enterprise org, <a href="mailto:[email protected]">contact our team</a>.</>
49
49
}
50
50
```
51
51
52
52
<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}`
53
+
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}`
54
54
</Note>
55
55
56
56
### Prefilling API Keys
@@ -71,9 +71,9 @@ groups: ['admin']
71
71
---
72
72
```
73
73
74
-
Here's a table that displays whether a page is shown for different combinations of `groups` in UserInfo and page metadata:
74
+
Here's a table that displays whether a page is shown for different combinations of `groups` in User and page metadata:
75
75
76
-
| | `groups` not in UserInfo | `groups: []` in UserInfo | `groups: ['admin']` in UserInfo |
76
+
| | `groups` not in User | `groups: []` in User | `groups: ['admin']` in User |
Copy file name to clipboardExpand all lines: settings/authentication-personalization/sending-data.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ description: 'The shape of user data you can use to personalize your docs'
6
6
Depending on your Handshake method, your API will respond with either a raw JSON object or a signed JWT. The shape of the data is the same for both:
7
7
8
8
```tsx
9
-
typeUserInfo= {
9
+
typeUser= {
10
10
expiresAt?:number;
11
11
groups?:string[];
12
12
content?:Record<string, any>;
@@ -36,7 +36,7 @@ type UserInfo = {
36
36
path="content"
37
37
type="object"
38
38
>
39
-
A bag of values that can be accessed from within MDX content using the `userContext` variable. For example, if you have supplied `{ firstName: 'Ronan' }` as your content field, you can use the following in your MDX: `Good morning, {userContext.firstName}!`
39
+
A bag of values that can be accessed from within MDX content using the `user` variable. For example, if you have supplied `{ firstName: 'Ronan' }` as your content field, you can use the following in your MDX: `Good morning, {user.firstName}!`
0 commit comments