@revturbine/sdk 0.9.1 → 0.9.2

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
@@ -19452,7 +19452,7 @@ type ExportedConfigProvider = RevTurbineConfigProvider;
19452
19452
  * ```ts
19453
19453
  * import { initRevTurbine } from '@revturbine/sdk';
19454
19454
  *
19455
- * const sdk = initRevTurbine({
19455
+ * const session = await initRevTurbine({
19456
19456
  * tenantId: 'tenant_abc',
19457
19457
  * apiKey: 'rt_live_xxx',
19458
19458
  * endpoint: 'https://edge.example.com',
@@ -20303,15 +20303,17 @@ declare const EMITTABLE_PLATFORM_EVENT_NAMES: readonly string[];
20303
20303
  *
20304
20304
  * @example
20305
20305
  * ```ts
20306
- * const sdk = initRevTurbine({
20306
+ * import { initRevTurbine } from '@revturbine/sdk';
20307
+ *
20308
+ * const session = await initRevTurbine({
20307
20309
  * tenantId: 'tenant_abc',
20308
20310
  * apiKey: 'rt_live_xxx',
20309
20311
  * endpoint: 'https://edge.example.com',
20310
20312
  * mode: 'react',
20311
20313
  * });
20312
20314
  *
20313
- * sdk.identify('user_123', { plan: 'pro' });
20314
- * const decision = await sdk.getPlacementDecision({ placementId, userId: 'user_123' });
20315
+ * session.identify('user_123', { plan_handle: 'pro' });
20316
+ * const branding = session.sdk.getBranding();
20315
20317
  * ```
20316
20318
  */
20317
20319
  declare class RevTurbineCustomerSdk {
@@ -21022,8 +21024,8 @@ declare class RevTurbineCustomerSdk {
21022
21024
  * @example
21023
21025
  * ```ts
21024
21026
  * // In your React component / page hydration:
21025
- * const sdk = initRevTurbine({ tenantId, apiKey, endpoint, mode: 'react' });
21026
- * sdk.hydrate(serverPayload);
21027
+ * const session = await initRevTurbine({ tenantId, apiKey, endpoint, mode: 'react' });
21028
+ * session.sdk.hydrate(serverPayload);
21027
21029
  * ```
21028
21030
  */
21029
21031
  hydrate(payload: ServerEvaluationHydrationPayload): void;
@@ -21584,19 +21586,18 @@ declare class RevTurbineCustomerSdk {
21584
21586
  }): void;
21585
21587
  }
21586
21588
  /**
21587
- * Initialize the RevTurbine SDK.
21589
+ * Initialize the synchronous RevTurbine core SDK.
21588
21590
  *
21589
- * This is the primary entry point for browser integration.
21590
- * Also available as `window.RevTurbine.init()` for non-module environments.
21591
+ * Available as `window.RevTurbine.init()` for non-module environments.
21592
+ * The package entrypoints expose the asynchronous session initializer instead:
21593
+ * `const session = await initRevTurbine(options); const sdk = session.sdk;`.
21591
21594
  *
21592
21595
  * @param options - SDK initialization options
21593
21596
  * @returns A configured SDK instance
21594
21597
  *
21595
21598
  * @example
21596
21599
  * ```ts
21597
- * import { initRevTurbine } from '@revturbine/sdk';
21598
- *
21599
- * const sdk = initRevTurbine({
21600
+ * const sdk = window.RevTurbine?.init({
21600
21601
  * tenantId: 'tenant_abc',
21601
21602
  * apiKey: 'rt_live_xxx',
21602
21603
  * endpoint: 'https://edge.example.com',
@@ -21749,6 +21750,7 @@ type RevTurbineThemeInput = {
21749
21750
  * tenantId: 'tenant_abc',
21750
21751
  * apiKey: 'rt_live_xxx',
21751
21752
  * endpoint: 'https://edge.example.com',
21753
+ * mode: 'snippet',
21752
21754
  * user: { id: 'user_123', plan_handle: 'pro' },
21753
21755
  * });
21754
21756
  *
@@ -22122,6 +22124,7 @@ type SdkSessionOptions = RevTurbineInitInputOptions & {
22122
22124
  * tenantId: 'tenant_abc',
22123
22125
  * apiKey: 'rt_live_xxx',
22124
22126
  * endpoint: 'https://edge.example.com',
22127
+ * mode: 'snippet',
22125
22128
  * user: { id: 'user_123', plan_handle: 'pro' },
22126
22129
  * });
22127
22130
  *
@@ -22266,6 +22269,7 @@ declare class SdkSession {
22266
22269
  * tenantId: 'tenant_abc',
22267
22270
  * apiKey: 'rt_live_xxx',
22268
22271
  * endpoint: 'https://edge.example.com',
22272
+ * mode: 'snippet',
22269
22273
  * user: { id: 'user_123', plan_handle: 'pro' },
22270
22274
  * bootstrapPlacements: [
22271
22275
  * { placement: { name: 'pricing_banner' } },
@@ -26687,7 +26691,7 @@ declare function createBasicExperimentProvider(options: BasicBucketerOptions): E
26687
26691
  *
26688
26692
  * @example
26689
26693
  * ```ts
26690
- * import { createAnalyticsProvider } from '@revturbine/sdk';
26694
+ * import { createAnalyticsProvider, initRevTurbine } from '@revturbine/sdk';
26691
26695
  *
26692
26696
  * const analytics = createAnalyticsProvider({
26693
26697
  * handler: (eventName, properties) => {
@@ -26695,7 +26699,13 @@ declare function createBasicExperimentProvider(options: BasicBucketerOptions): E
26695
26699
  * },
26696
26700
  * });
26697
26701
  *
26698
- * initRevTurbine({ domainProviders: [analytics], ... });
26702
+ * const session = await initRevTurbine({
26703
+ * tenantId: 'tenant_abc',
26704
+ * apiKey: 'rt_live_xxx',
26705
+ * endpoint: 'https://edge.example.com',
26706
+ * mode: 'snippet',
26707
+ * domainProviders: [analytics],
26708
+ * });
26699
26709
  * ```
26700
26710
  *
26701
26711
  * @module
@@ -26839,7 +26849,13 @@ interface PostHogAnalyticsProviderOptions {
26839
26849
  * import { createPostHogAnalyticsProvider, initRevTurbine } from '@revturbine/sdk';
26840
26850
  *
26841
26851
  * const analytics = createPostHogAnalyticsProvider({ posthog });
26842
- * initRevTurbine({ domainProviders: [analytics], ... });
26852
+ * const session = await initRevTurbine({
26853
+ * tenantId: 'tenant_abc',
26854
+ * apiKey: 'rt_live_xxx',
26855
+ * endpoint: 'https://edge.example.com',
26856
+ * mode: 'snippet',
26857
+ * domainProviders: [analytics],
26858
+ * });
26843
26859
  * ```
26844
26860
  */
26845
26861
  declare function createPostHogAnalyticsProvider(options: PostHogAnalyticsProviderOptions): EventConsumerProvider;