@revturbine/sdk 0.2.80 → 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
@@ -12151,6 +12151,20 @@ interface RevTurbineInitOptions {
12151
12151
  * when no explicit {@link branding} and no legacy config-embedded theme apply.
12152
12152
  */
12153
12153
  apiBranding?: BrandingConfig;
12154
+ /**
12155
+ * Fetch the tenant's theme overrides from the control plane's
12156
+ * `GET /api/sdk/theme` and apply them OVER the launched Playbook's theme
12157
+ * (plan 184).
12158
+ *
12159
+ * Opt-in and `false` by default, deliberately: the SDK otherwise issues no
12160
+ * theme request at all, so an integration with no branding configured never
12161
+ * pays a round-trip — and never logs a failed one. Enable it when branding is
12162
+ * managed from the RevTurbine dashboard and should change without a redeploy.
12163
+ *
12164
+ * Independent of {@link apiBranding}, which is the same rung supplied by the
12165
+ * host instead of fetched by the SDK.
12166
+ */
12167
+ fetchThemeOverride?: boolean;
12154
12168
  }
12155
12169
  /** Base init options shared by all runtime mode helper builders. */
12156
12170
  type RevTurbineInitBaseOptions = Omit<RevTurbineInitOptions, 'runtimeMode' | 'endpointOverrides' | 'localRuntime'>;
@@ -21234,6 +21248,12 @@ interface ThemeLoaderOptions {
21234
21248
  apiKey: string;
21235
21249
  /** Optional storage provider. Falls back to localStorage in browser, in-memory on server. */
21236
21250
  storage?: RevTurbineStorage;
21251
+ /**
21252
+ * The launched Playbook's theme, used as the BASE that fetched overrides
21253
+ * merge over (plan 184). Supplying it means a partial override from the
21254
+ * control plane refines the Playbook's theme instead of replacing it.
21255
+ */
21256
+ base?: RevTurbineThemeInput;
21237
21257
  }
21238
21258
  /**
21239
21259
  * Load the tenant's theme:
@@ -21481,6 +21501,34 @@ type RevTurbineProviderProps = {
21481
21501
  * Omit to disable. Memoize an object value to avoid re-installing.
21482
21502
  */
21483
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;
21484
21532
  /** React children. */
21485
21533
  children: React__default.ReactNode;
21486
21534
  };
@@ -21499,7 +21547,7 @@ type RevTurbineProviderProps = {
21499
21547
  * </RevTurbineProvider>
21500
21548
  * ```
21501
21549
  */
21502
- 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;
21503
21551
 
21504
21552
  type RevTurbineContextValue = {
21505
21553
  sdk: RevTurbineCustomerSdk | null;