rampkit-expo-dev 0.0.9 → 0.0.11

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.
@@ -12,11 +12,13 @@ export declare class RampKitCore {
12
12
  environment?: string;
13
13
  autoShowOnboarding?: boolean;
14
14
  onOnboardingFinished?: (payload?: any) => void;
15
- showPaywall?: () => void;
15
+ onShowPaywall?: (payload?: any) => void;
16
+ showPaywall?: (payload?: any) => void;
16
17
  }): Promise<void>;
17
18
  getOnboardingData(): any;
18
19
  getUserId(): string | null;
19
20
  showOnboarding(opts?: {
20
- showPaywall?: () => void;
21
+ onShowPaywall?: (payload?: any) => void;
22
+ showPaywall?: (payload?: any) => void;
21
23
  }): void;
22
24
  }
package/build/RampKit.js CHANGED
@@ -17,7 +17,7 @@ class RampKitCore {
17
17
  async init(config) {
18
18
  this.config = config;
19
19
  this.onOnboardingFinished = config.onOnboardingFinished;
20
- this.onShowPaywall = config.showPaywall;
20
+ this.onShowPaywall = config.onShowPaywall || config.showPaywall;
21
21
  try {
22
22
  // Ensure a stable, encrypted user id exists on first init
23
23
  this.userId = await (0, userId_1.getRampKitUserId)();
@@ -110,7 +110,7 @@ class RampKitCore {
110
110
  }
111
111
  catch (_) { }
112
112
  },
113
- onShowPaywall: (opts === null || opts === void 0 ? void 0 : opts.showPaywall) || this.onShowPaywall,
113
+ onShowPaywall: (opts === null || opts === void 0 ? void 0 : opts.onShowPaywall) || (opts === null || opts === void 0 ? void 0 : opts.showPaywall) || this.onShowPaywall,
114
114
  });
115
115
  }
116
116
  catch (e) {
@@ -13,7 +13,7 @@ export declare function showRampkitOverlay(opts: {
13
13
  requiredScripts?: string[];
14
14
  onClose?: () => void;
15
15
  onOnboardingFinished?: (payload?: any) => void;
16
- onShowPaywall?: () => void;
16
+ onShowPaywall?: (payload?: any) => void;
17
17
  }): void;
18
18
  export declare function hideRampkitOverlay(): void;
19
19
  export declare function preloadRampkitOverlay(opts: {
@@ -30,6 +30,6 @@ declare function Overlay(props: {
30
30
  prebuiltDocs?: string[];
31
31
  onRequestClose: () => void;
32
32
  onOnboardingFinished?: (payload?: any) => void;
33
- onShowPaywall?: () => void;
33
+ onShowPaywall?: (payload?: any) => void;
34
34
  }): any;
35
35
  export default Overlay;
@@ -579,7 +579,7 @@ function Overlay(props) {
579
579
  // 6) Request to show paywall
580
580
  if ((data === null || data === void 0 ? void 0 : data.type) === "rampkit:show-paywall") {
581
581
  try {
582
- (_b = props.onShowPaywall) === null || _b === void 0 ? void 0 : _b.call(props);
582
+ (_b = props.onShowPaywall) === null || _b === void 0 ? void 0 : _b.call(props, data === null || data === void 0 ? void 0 : data.payload);
583
583
  }
584
584
  catch (_) { }
585
585
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampkit-expo-dev",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "The Expo SDK for RampKit. Build, test, and personalize app onboardings with instant updates.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",