@revturbine/sdk 0.2.81 → 0.2.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -21501,6 +21501,34 @@ type RevTurbineProviderProps = {
21501
21501
  * Omit to disable. Memoize an object value to avoid re-installing.
21502
21502
  */
21503
21503
  domCapture?: boolean | AnnotatedCaptureOptions;
21504
+ /**
21505
+ * A server-evaluated payload to hydrate the SDK from (plan 186 TASK-2).
21506
+ *
21507
+ * Produced by the server SDK — `RevTurbineServer.evaluate()` or
21508
+ * `LocalEvaluationServer.evaluate()` — and serialized into page props / RSC
21509
+ * props. Applied synchronously the moment the SDK instance exists, before any
21510
+ * awaited init work, so the decisions and entitlements it carries are already
21511
+ * cached the first time a gate reads them. Without it, a server-rendered app
21512
+ * evaluates once on the server and then re-evaluates from scratch on the
21513
+ * client.
21514
+ *
21515
+ * Carries no credential — it is built for browser delivery. A malformed or
21516
+ * unknown-version payload is logged and skipped rather than thrown: hydration
21517
+ * is an optimization, so a bad payload degrades to normal client-side
21518
+ * evaluation instead of breaking the provider.
21519
+ *
21520
+ * Re-hydrates when the payload's identity changes (e.g. a server navigation
21521
+ * supplies a fresh one), so a provider mounted in a root layout stays current
21522
+ * without remounting. Memoize a value you rebuild every render.
21523
+ *
21524
+ * @example
21525
+ * ```tsx
21526
+ * // app/layout.tsx (Server Component)
21527
+ * const payload = await server.evaluate({ userId, placements: [{ slotId: 'hero' }] });
21528
+ * return <RevTurbineProvider options={options} serverPayload={payload}>{children}</RevTurbineProvider>;
21529
+ * ```
21530
+ */
21531
+ serverPayload?: ServerEvaluationHydrationPayload;
21504
21532
  /** React children. */
21505
21533
  children: React__default.ReactNode;
21506
21534
  };
@@ -21519,7 +21547,7 @@ type RevTurbineProviderProps = {
21519
21547
  * </RevTurbineProvider>
21520
21548
  * ```
21521
21549
  */
21522
- declare function RevTurbineProvider({ options, bootstrapPlacements, domCapture, children }: RevTurbineProviderProps): React__default.JSX.Element;
21550
+ declare function RevTurbineProvider({ options, bootstrapPlacements, domCapture, serverPayload, children }: RevTurbineProviderProps): React__default.JSX.Element;
21523
21551
 
21524
21552
  type RevTurbineContextValue = {
21525
21553
  sdk: RevTurbineCustomerSdk | null;