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: README.md
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,12 +216,44 @@ _props_
216
216
| Prop | Type | Required | Description |
217
217
| --- | --- | --- | --- |
218
218
|`client`|`Client`| Yes | Instance created from `createInstance`. |
219
-
|`user`|`{ id?: string; attributes?: UserAttributes }`| No | User info object — `id` and `attributes` will be used to create the user context for all decisions and event tracking. |
219
+
|`user`|`{ id?: string; attributes?: UserAttributes } \| null`| No | User info object — `id` and `attributes` will be used to create the user context for all decisions and event tracking. Pass `null`, `undefined`, or omit while user info is being fetched — hooks will return `{ isLoading: true }` until a resolved user is provided. For VUID-only mode (no user ID), pass `user={{}}`. |
220
220
|`timeout`|`number`| No | Maximum time (in milliseconds) to wait for the SDK to become ready before hooks resolve with a loading state. Default: `30000`. |
221
221
|`qualifiedSegments`|`string[]`| No | Pre-fetched ODP audience segments for the user. Use [`getQualifiedSegments`](#getqualifiedsegments) to obtain these segments server-side. |
222
222
|`skipSegments`|`boolean`| No | When `true`, skips background ODP segment fetching. Default: `false`. |
223
223
224
-
> **Note:** Unless VUID is enabled, `<OptimizelyProvider>` requires user data. If user information must be fetched asynchronously, resolve the promise before rendering the Provider.
224
+
> **Note:** If user information is not yet available, you can render `<OptimizelyProvider>` without it — hooks will return `{ isLoading: true }` until a resolved user is provided. For VUID-only mode (no user ID), pass `user={{}}`.
Copy file name to clipboardExpand all lines: docs/nextjs-integration.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -445,12 +445,15 @@ export default function MyFeature() {
445
445
446
446
### User Promise not supported
447
447
448
-
User `Promise` is not supported. You must provide a resolved user object to `OptimizelyProvider`. If user information must be fetched asynchronously, resolve the promise before rendering the Provider:
448
+
User `Promise` is not supported. You can pass `null`, `undefined`, or omit the `user` prop while user information is being fetched — hooks will return `{ isLoading: true }` until a resolved user object is provided. For VUID-only mode (no user ID), pass `user={{}}`.
0 commit comments