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: authentication-personalization/personalization-setup.mdx
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,21 +59,24 @@ type User = {
59
59
<ParamField
60
60
path="expiresAt"
61
61
type="number"
62
+
optional
62
63
>
63
64
Session expiration time in **seconds since epoch**. If the user loads a page after this time, their stored data is automatically deleted and they must reauthenticate.
64
65
<Warning><b>For JWT handshakes:</b> This differs from the JWT's `exp` claim, which determines when a JWT is considered invalid. Set the JWT `exp` claim to a short duration (10 seconds or less) for security. Use `expiresAt` for the actual session length (hours to weeks).</Warning>
65
66
</ParamField>
66
67
<ParamField
67
68
path="groups"
68
69
type="string[]"
70
+
optional
69
71
>
70
-
A list of groups that the user belongs to. Pages with a matching `groups`field in their metadata will be visible to this user.
72
+
List of groups the user belongs to. Pages with matching `groups` in their frontmatter are visible to this user.
71
73
72
74
**Example**: User with `groups: ["admin", "engineering"]` can access pages tagged with either the `admin` or `engineering` groups.
73
75
</ParamField>
74
76
<ParamField
75
77
path="content"
76
78
type="object"
79
+
optional
77
80
>
78
81
Custom data accessible in your `MDX` content via the `user` variable. Use this for dynamic personalization throughout your documentation.
79
82
@@ -100,21 +103,22 @@ type User = {
100
103
```
101
104
102
105
<Note>
103
-
The information in `user` is only available for logged-in users. For logged-out users, the value of `user` will be `{}`. To prevent the page from crashing for loggedout users, always use optional chaining on your `user` fields. For example, `{user.org?.plan}`.
106
+
The information in `user` is only available for logged-in users. 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. For example, `{user.org?.plan}`.
104
107
</Note>
105
108
</ParamField>
106
109
<ParamField
107
110
path="apiPlaygroundInputs"
108
111
type="object"
112
+
optional
109
113
>
110
-
User-specific values that will be prefilled in the API playground if supplied. Save users time when testing your APIs with their own data.
114
+
User-specific values that prefill API playground fields. Saves users time by auto-populating their data when testing APIs.
111
115
112
116
**Example**:
113
117
```json
114
118
{
115
-
"header": { "X-API-Key":"user_api_key_123" },
116
-
"server": { "subdomain":"foo" },
117
-
"query": { "org_id":"12345" }
119
+
"header": { "X-API-Key":"user_api_key_123" },
120
+
"server": { "subdomain":"foo" },
121
+
"query": { "org_id":"12345" }
118
122
}
119
123
```
120
124
If a user makes requests at a specific subdomain, you can send `{ server: { subdomain:'foo' } }` as an `apiPlaygroundInputs` field. This value will be prefilled on any API page with the `subdomain` value.
0 commit comments