@revenuecat/purchases-js 1.54.0 → 1.55.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.
@@ -134,6 +134,20 @@ export declare interface CustomerInfo {
134
134
  };
135
135
  }
136
136
 
137
+ /**
138
+ * Parameters for tracking an impression of a custom paywall.
139
+ *
140
+ * Pass the offering used to render the paywall to include its offering,
141
+ * placement, and targeting attribution in the event.
142
+ * @public
143
+ */
144
+ export declare interface CustomPaywallImpressionParams {
145
+ /** An optional identifier for the custom paywall shown to the customer. */
146
+ paywallId?: string;
147
+ /** The offering used to render the custom paywall. */
148
+ offering?: Offering;
149
+ }
150
+
137
151
  /**
138
152
  * Custom translations to be used in the purchase flow.
139
153
  * This class allows you to override the default translations used in the purchase flow.
@@ -1426,7 +1440,9 @@ export declare interface PurchaseParams {
1426
1440
  showDiscountCodeField?: boolean;
1427
1441
  /**
1428
1442
  * @experimental
1429
- * Initial discount code to display as applied in the Web Billing checkout.
1443
+ * Initial discount code to apply at checkout.
1444
+ * For Web Billing this is displayed as applied in the checkout UI.
1445
+ * For Paddle this is passed to Paddle Checkout as `discountCode`.
1430
1446
  * This is useful when the code originated outside of the checkout UI,
1431
1447
  * for example from a URL parameter.
1432
1448
  */
@@ -1503,6 +1519,7 @@ export declare class Purchases {
1503
1519
  /* Excluded from this release type: eventsTracker */
1504
1520
  /* Excluded from this release type: _platformInfo */
1505
1521
  /* Excluded from this release type: inMemoryCache */
1522
+ /* Excluded from this release type: cachedCurrentOffering */
1506
1523
  /* Excluded from this release type: instance */
1507
1524
  /**
1508
1525
  * Set the log level. Logs of the given level and below will be printed
@@ -1578,6 +1595,20 @@ export declare class Purchases {
1578
1595
  * @param params - The parameters object to customise the offerings fetch. Check {@link GetOfferingsParams}
1579
1596
  */
1580
1597
  getOfferings(params?: GetOfferingsParams): Promise<Offerings>;
1598
+ /**
1599
+ * Tracks an impression for a custom paywall.
1600
+ *
1601
+ * Pass the offering used to render the paywall to preserve placement and
1602
+ * targeting attribution. When no offering is passed, the most recently
1603
+ * fetched current offering is used if available.
1604
+ *
1605
+ * Each call creates a separate impression event. Call this once per
1606
+ * paywall presentation and avoid lifecycle callbacks that may run
1607
+ * multiple times for the same display.
1608
+ *
1609
+ * @param params Parameters for the custom paywall impression event.
1610
+ */
1611
+ trackCustomPaywallImpression(params?: CustomPaywallImpressionParams): void;
1581
1612
  /**
1582
1613
  * Retrieves a specific offering by a placement identifier.
1583
1614
  * For more info see https://www.revenuecat.com/docs/tools/targeting