Skip to content

Commit 706a2b4

Browse files
committed
update all ParamFields
1 parent a6d7946 commit 706a2b4

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

authentication-personalization/personalization-setup.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,24 @@ type User = {
5959
<ParamField
6060
path="expiresAt"
6161
type="number"
62+
optional
6263
>
6364
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.
6465
<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>
6566
</ParamField>
6667
<ParamField
6768
path="groups"
6869
type="string[]"
70+
optional
6971
>
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.
7173
7274
**Example**: User with `groups: ["admin", "engineering"]` can access pages tagged with either the `admin` or `engineering` groups.
7375
</ParamField>
7476
<ParamField
7577
path="content"
7678
type="object"
79+
optional
7780
>
7881
Custom data accessible in your `MDX` content via the `user` variable. Use this for dynamic personalization throughout your documentation.
7982
@@ -100,21 +103,22 @@ type User = {
100103
```
101104
102105
<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 logged out 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}`.
104107
</Note>
105108
</ParamField>
106109
<ParamField
107110
path="apiPlaygroundInputs"
108111
type="object"
112+
optional
109113
>
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.
111115
112116
**Example**:
113117
```json
114118
{
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" }
118122
}
119123
```
120124
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

Comments
 (0)