@revenuecat/purchases-js 1.27.0 → 1.29.0

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.
@@ -1,3 +1,5 @@
1
+ import { CustomVariables } from '@revenuecat/purchases-ui-js';
2
+ import { CustomVariableValue } from '@revenuecat/purchases-ui-js';
1
3
  import { PaywallData } from '@revenuecat/purchases-ui-js';
2
4
  import { UIConfig } from '@revenuecat/purchases-ui-js';
3
5
 
@@ -146,6 +148,10 @@ declare type CustomTranslations = {
146
148
  };
147
149
  };
148
150
 
151
+ export { CustomVariables }
152
+
153
+ export { CustomVariableValue }
154
+
149
155
  /* Excluded from this release type: DiscountPhase */
150
156
 
151
157
  declare type EmptyString = "";
@@ -309,6 +315,13 @@ export declare interface FlagsConfig {
309
315
  collectAnalyticsEvents?: boolean;
310
316
  /* Excluded from this release type: rcSource */
311
317
  /* Excluded from this release type: forceEnableWalletMethods */
318
+ /**
319
+ * Determines when the store module (e.g. Stripe) is loaded.
320
+ * - `"configuration"`: Preloaded when the SDK is configured (default).
321
+ * - `"purchase_start"`: Loaded on demand when a purchase is started.
322
+ * @defaultValue "configuration"
323
+ */
324
+ storeLoadTime?: StoreLoadTime;
312
325
  }
313
326
 
314
327
  /**
@@ -873,6 +886,25 @@ export declare interface PresentPaywallParams {
873
886
  * Whether to hide back buttons in the paywall. Defaults to false.
874
887
  */
875
888
  readonly hideBackButtons?: boolean;
889
+ /**
890
+ * Custom variables to pass to the paywall at runtime, overriding defaults set
891
+ * in the RevenueCat dashboard.
892
+ *
893
+ * Variables must be defined in the dashboard first. Reference them in paywall
894
+ * text using the `custom.` prefix (e.g. `{{ custom.player_name }}`).
895
+ *
896
+ * @example
897
+ * ```ts
898
+ * presentPaywall({
899
+ * customVariables: {
900
+ * player_name: CustomVariableValue.string('Ada'),
901
+ * level: CustomVariableValue.number(42),
902
+ * is_premium: CustomVariableValue.boolean(true),
903
+ * },
904
+ * });
905
+ * ```
906
+ */
907
+ readonly customVariables?: CustomVariables;
876
908
  }
877
909
 
878
910
  /**
@@ -1126,6 +1158,7 @@ export declare interface PurchaseParams {
1126
1158
  */
1127
1159
  customerEmail?: string;
1128
1160
  /* Excluded from this release type: workflowPurchaseContext */
1161
+ /* Excluded from this release type: paywallId */
1129
1162
  /**
1130
1163
  * The locale to use for the purchase flow. If not specified, English will be used
1131
1164
  */
@@ -1307,6 +1340,7 @@ export declare class Purchases {
1307
1340
  * @throws {@link PurchasesError} if there is an error while performing the purchase. If the {@link PurchasesError.errorCode} is {@link ErrorCode.UserCancelledError}, the user cancelled the purchase.
1308
1341
  */
1309
1342
  purchase(params: PurchaseParams): Promise<PurchaseResult>;
1343
+ private performStripePurchase;
1310
1344
  private performWebBillingPurchase;
1311
1345
  private performPaddlePurchase;
1312
1346
  /**
@@ -1733,6 +1767,14 @@ export declare class Purchases {
1733
1767
  */
1734
1768
  export declare type Store = "app_store" | "mac_app_store" | "play_store" | "amazon" | "stripe" | "rc_billing" | "promotional" | "paddle" | "test_store" | "unknown";
1735
1769
 
1770
+ /**
1771
+ * Determines when the store module (e.g. Stripe) is loaded.
1772
+ * - `"configuration"`: The store module is preloaded when the SDK is configured.
1773
+ * - `"purchase_start"`: The store module is loaded on demand when a purchase is started.
1774
+ * @public
1775
+ */
1776
+ export declare type StoreLoadTime = "configuration" | "purchase_start";
1777
+
1736
1778
  /**
1737
1779
  * Represents a transaction made in the store.
1738
1780
  * @public