react-native-purchases 4.6.0 → 5.0.0-beta.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/errors.d.ts CHANGED
@@ -34,6 +34,9 @@ export interface PurchasesError {
34
34
  export interface ErrorInfo {
35
35
  readableErrorCode: string;
36
36
  }
37
+ /**
38
+ * @internal
39
+ */
37
40
  export declare class UninitializedPurchasesError extends Error {
38
41
  constructor();
39
42
  }
package/dist/errors.js CHANGED
@@ -41,6 +41,9 @@ var PURCHASES_ERROR_CODE;
41
41
  PURCHASES_ERROR_CODE["INVALID_SUBSCRIBER_ATTRIBUTES_ERROR"] = "21";
42
42
  PURCHASES_ERROR_CODE["LOG_OUT_ANONYMOUS_USER_ERROR"] = "22";
43
43
  })(PURCHASES_ERROR_CODE = exports.PURCHASES_ERROR_CODE || (exports.PURCHASES_ERROR_CODE = {}));
44
+ /**
45
+ * @internal
46
+ */
44
47
  var UninitializedPurchasesError = /** @class */ (function (_super) {
45
48
  __extends(UninitializedPurchasesError, _super);
46
49
  function UninitializedPurchasesError() {
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import Purchases from './purchases';
2
2
  export default Purchases;
3
3
  export * from './errors';
4
- export * from './purchaserInfo';
4
+ export * from './customerInfo';
5
5
  export * from './purchases';
6
6
  export * from './offerings';
package/dist/index.js CHANGED
@@ -16,6 +16,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  var purchases_1 = __importDefault(require("./purchases"));
17
17
  exports.default = purchases_1.default;
18
18
  __exportStar(require("./errors"), exports);
19
- __exportStar(require("./purchaserInfo"), exports);
19
+ __exportStar(require("./customerInfo"), exports);
20
20
  __exportStar(require("./purchases"), exports);
21
21
  __exportStar(require("./offerings"), exports);
@@ -48,9 +48,13 @@ export declare enum INTRO_ELIGIBILITY_STATUS {
48
48
  /**
49
49
  * The user is eligible for a free trial or intro pricing for this product.
50
50
  */
51
- INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2
51
+ INTRO_ELIGIBILITY_STATUS_ELIGIBLE = 2,
52
+ /**
53
+ * There is no free trial or intro pricing for this product.
54
+ */
55
+ INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS = 3
52
56
  }
53
- export interface PurchasesProduct {
57
+ export interface PurchasesStoreProduct {
54
58
  /**
55
59
  * Product Id.
56
60
  */
@@ -70,47 +74,11 @@ export interface PurchasesProduct {
70
74
  /**
71
75
  * Formatted price of the item, including its currency sign.
72
76
  */
73
- readonly price_string: string;
77
+ readonly priceString: string;
74
78
  /**
75
79
  * Currency code for price and original price.
76
80
  */
77
- readonly currency_code: string;
78
- /**
79
- * @deprecated, use introPrice instead.
80
- *
81
- * Introductory price of a subscription in the local currency.
82
- */
83
- readonly intro_price: number | null;
84
- /**
85
- * @deprecated, use introPrice instead.
86
- *
87
- * Formatted introductory price of a subscription, including its currency sign, such as €3.99.
88
- */
89
- readonly intro_price_string: string | null;
90
- /**
91
- * @deprecated, use introPrice instead.
92
- *
93
- * Billing period of the introductory price, specified in ISO 8601 format.
94
- */
95
- readonly intro_price_period: string | null;
96
- /**
97
- * @deprecated, use introPrice instead.
98
- *
99
- * Number of subscription billing periods for which the user will be given the introductory price, such as 3.
100
- */
101
- readonly intro_price_cycles: number | null;
102
- /**
103
- * @deprecated, use introPrice instead.
104
- *
105
- * Unit for the billing period of the introductory price, can be DAY, WEEK, MONTH or YEAR.
106
- */
107
- readonly intro_price_period_unit: string | null;
108
- /**
109
- * @deprecated, use introPrice instead.
110
- *
111
- * Number of units for the billing period of the introductory price.
112
- */
113
- readonly intro_price_period_number_of_units: number | null;
81
+ readonly currencyCode: string;
114
82
  /**
115
83
  * Introductory price.
116
84
  */
@@ -118,9 +86,9 @@ export interface PurchasesProduct {
118
86
  /**
119
87
  * Collection of discount offers for a product. Null for Android.
120
88
  */
121
- readonly discounts: PurchasesDiscount[] | null;
89
+ readonly discounts: PurchasesStoreProductDiscount[] | null;
122
90
  }
123
- export interface PurchasesDiscount {
91
+ export interface PurchasesStoreProductDiscount {
124
92
  /**
125
93
  * Identifier of the discount.
126
94
  */
@@ -192,7 +160,7 @@ export interface PurchasesPackage {
192
160
  /**
193
161
  * Product assigned to this package.
194
162
  */
195
- readonly product: PurchasesProduct;
163
+ readonly product: PurchasesStoreProduct;
196
164
  /**
197
165
  * Offering this package belongs to.
198
166
  */
@@ -286,7 +254,7 @@ export interface IntroEligibility {
286
254
  */
287
255
  readonly description: string;
288
256
  }
289
- export interface PurchasesPaymentDiscount {
257
+ export interface PurchasesPromotionalOffer {
290
258
  readonly identifier: string;
291
259
  readonly keyIdentifier: string;
292
260
  readonly nonce: string;
package/dist/offerings.js CHANGED
@@ -54,6 +54,10 @@ var INTRO_ELIGIBILITY_STATUS;
54
54
  * The user is eligible for a free trial or intro pricing for this product.
55
55
  */
56
56
  INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_ELIGIBLE"] = 2] = "INTRO_ELIGIBILITY_STATUS_ELIGIBLE";
57
+ /**
58
+ * There is no free trial or intro pricing for this product.
59
+ */
60
+ INTRO_ELIGIBILITY_STATUS[INTRO_ELIGIBILITY_STATUS["INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS"] = 3] = "INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS";
57
61
  })(INTRO_ELIGIBILITY_STATUS = exports.INTRO_ELIGIBILITY_STATUS || (exports.INTRO_ELIGIBILITY_STATUS = {}));
58
62
  var PRORATION_MODE;
59
63
  (function (PRORATION_MODE) {
@@ -1,25 +1,17 @@
1
1
  import { PURCHASES_ERROR_CODE, UninitializedPurchasesError } from "./errors";
2
- import { PurchaserInfo } from "./purchaserInfo";
3
- import { PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesProduct, UpgradeInfo, PurchasesPaymentDiscount, PurchasesPackage, IntroEligibility, PurchasesDiscount } from "./offerings";
2
+ import { CustomerInfo } from "./customerInfo";
3
+ import { PRORATION_MODE, PACKAGE_TYPE, INTRO_ELIGIBILITY_STATUS, PurchasesOfferings, PurchasesStoreProduct, UpgradeInfo, PurchasesPromotionalOffer, PurchasesPackage, IntroEligibility, PurchasesStoreProductDiscount } from "./offerings";
4
4
  /**
5
- * Listener used on updated purchaser info
6
- * @callback PurchaserInfoUpdateListener
7
- * @param {Object} purchaserInfo Object containing info for the purchaser
5
+ * Listener used on updated customer info
6
+ * @callback CustomerInfoUpdateListener
7
+ * @param {Object} customerInfo Object containing info for the customer
8
8
  */
9
- export declare type PurchaserInfoUpdateListener = (purchaserInfo: PurchaserInfo) => void;
9
+ export declare type CustomerInfoUpdateListener = (customerInfo: CustomerInfo) => void;
10
10
  export declare type ShouldPurchasePromoProductListener = (deferredPurchase: () => Promise<MakePurchaseResult>) => void;
11
11
  export declare type MakePurchaseResult = {
12
12
  productIdentifier: string;
13
- purchaserInfo: PurchaserInfo;
13
+ customerInfo: CustomerInfo;
14
14
  };
15
- export declare enum ATTRIBUTION_NETWORK {
16
- APPLE_SEARCH_ADS = 0,
17
- ADJUST = 1,
18
- APPSFLYER = 2,
19
- BRANCH = 3,
20
- TENJIN = 4,
21
- FACEBOOK = 5
22
- }
23
15
  export declare enum PURCHASE_TYPE {
24
16
  /**
25
17
  * A type of SKU for in-app products.
@@ -62,29 +54,15 @@ export declare enum BILLING_FEATURE {
62
54
  */
63
55
  export interface LogInResult {
64
56
  /**
65
- * The Purchaser Info for the user.
57
+ * The Customer Info for the user.
66
58
  */
67
- readonly purchaserInfo: PurchaserInfo;
59
+ readonly customerInfo: CustomerInfo;
68
60
  /**
69
61
  * True if the call resulted in a new user getting created in the RevenueCat backend.
70
62
  */
71
63
  readonly created: boolean;
72
64
  }
73
65
  export default class Purchases {
74
- /**
75
- * Enum for attribution networks
76
- * @readonly
77
- * @enum {number}
78
- */
79
- static ATTRIBUTION_NETWORK: typeof ATTRIBUTION_NETWORK;
80
- /**
81
- * @deprecated use ATTRIBUTION_NETWORK instead
82
- *
83
- * Enum for attribution networks
84
- * @readonly
85
- * @enum {number}
86
- */
87
- static ATTRIBUTION_NETWORKS: typeof ATTRIBUTION_NETWORK;
88
66
  /**
89
67
  * Supported SKU types.
90
68
  * @readonly
@@ -123,17 +101,21 @@ export default class Purchases {
123
101
  * @enum {string}
124
102
  */
125
103
  static PURCHASES_ERROR_CODE: typeof PURCHASES_ERROR_CODE;
104
+ /**
105
+ * @internal
106
+ */
126
107
  static UninitializedPurchasesError: typeof UninitializedPurchasesError;
127
108
  /**
128
109
  * Sets up Purchases with your API key and an app user id.
129
110
  * @param {String} apiKey RevenueCat API Key. Needs to be a String
130
111
  * @param {String?} appUserID An optional unique id for identifying the user. Needs to be a string.
131
- * @param {boolean?} observerMode An optional boolean. Set this to TRUE if you have your own IAP implementation and want to use only RevenueCat's backend. Default is FALSE.
112
+ * @param {boolean} [observerMode=false] An optional boolean. Set this to TRUE if you have your own IAP implementation and want to use only RevenueCat's backend. Default is FALSE.
113
+ * @param {boolean} [usesStoreKit2IfAvailable=false] An optional boolean. iOS-only. Set this to TRUE to enable StoreKit2 on compatible devices.
132
114
  * @param {String?} userDefaultsSuiteName An optional string. iOS-only, will be ignored for Android.
133
115
  * Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults.
134
116
  * Default is null, which will make the SDK use standardUserDefaults.
135
117
  */
136
- static setup(apiKey: string, appUserID?: string | null, observerMode?: boolean, userDefaultsSuiteName?: string): void;
118
+ static configure(apiKey: string, appUserID?: string | null, observerMode?: boolean, userDefaultsSuiteName?: string, usesStoreKit2IfAvailable?: boolean): void;
137
119
  /**
138
120
  * @deprecated, configure behavior through the RevenueCat dashboard instead.
139
121
  * If an user tries to purchase a product that is active on the current app store account,
@@ -157,16 +139,16 @@ export default class Purchases {
157
139
  */
158
140
  static setSimulatesAskToBuyInSandbox(simulatesAskToBuyInSandbox: boolean): Promise<void>;
159
141
  /**
160
- * Sets a function to be called on updated purchaser info
161
- * @param {PurchaserInfoUpdateListener} purchaserInfoUpdateListener PurchaserInfo update listener
142
+ * Sets a function to be called on updated customer info
143
+ * @param {CustomerInfoUpdateListener} customerInfoUpdateListener CustomerInfo update listener
162
144
  */
163
- static addPurchaserInfoUpdateListener(purchaserInfoUpdateListener: PurchaserInfoUpdateListener): void;
145
+ static addCustomerInfoUpdateListener(customerInfoUpdateListener: CustomerInfoUpdateListener): void;
164
146
  /**
165
- * Removes a given PurchaserInfoUpdateListener
166
- * @param {PurchaserInfoUpdateListener} listenerToRemove PurchaserInfoUpdateListener reference of the listener to remove
147
+ * Removes a given CustomerInfoUpdateListener
148
+ * @param {CustomerInfoUpdateListener} listenerToRemove CustomerInfoUpdateListener reference of the listener to remove
167
149
  * @returns {boolean} True if listener was removed, false otherwise
168
150
  */
169
- static removePurchaserInfoUpdateListener(listenerToRemove: PurchaserInfoUpdateListener): boolean;
151
+ static removeCustomerInfoUpdateListener(listenerToRemove: CustomerInfoUpdateListener): boolean;
170
152
  /**
171
153
  * Sets a function to be called on purchases initiated on the Apple App Store. This is only used in iOS.
172
154
  * @param {ShouldPurchasePromoProductListener} shouldPurchasePromoProductListener Called when a user initiates a
@@ -184,18 +166,6 @@ export default class Purchases {
184
166
  * @returns {boolean} True if listener was removed, false otherwise
185
167
  */
186
168
  static removeShouldPurchasePromoProductListener(listenerToRemove: ShouldPurchasePromoProductListener): boolean;
187
- /**
188
- * @deprecated, use set<NetworkId> methods instead.
189
- *
190
- * Add a dict of attribution information
191
- * @param {Dict} data Attribution data from AppsFlyer, Adjust, or Branch
192
- * @param {ATTRIBUTION_NETWORKS} network Which network, see Purchases.ATTRIBUTION_NETWORKS
193
- * @param {String?} networkUserId An optional unique id for identifying the user. Needs to be a string.
194
- * @returns {Promise<void>} The promise will be rejected if setup has not been called yet.
195
- */
196
- static addAttributionData(data: {
197
- [key: string]: any;
198
- }, network: ATTRIBUTION_NETWORK, networkUserId?: string): Promise<void>;
199
169
  /**
200
170
  * Gets the map of entitlements -> offerings -> products
201
171
  * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if setup
@@ -206,12 +176,12 @@ export default class Purchases {
206
176
  * Fetch the product info
207
177
  * @param {String[]} productIdentifiers Array of product identifiers
208
178
  * @param {String} type Optional type of products to fetch, can be inapp or subs. Subs by default
209
- * @returns {Promise<PurchasesProduct[]>} A promise containing an array of products. The promise will be rejected
179
+ * @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected
210
180
  * if the products are not properly configured in RevenueCat or if there is another error retrieving them.
211
181
  * Rejections return an error code, and a userInfo object with more information. The promise will also be rejected
212
182
  * if setup has not been called yet.
213
183
  */
214
- static getProducts(productIdentifiers: string[], type?: PURCHASE_TYPE): Promise<PurchasesProduct[]>;
184
+ static getProducts(productIdentifiers: string[], type?: PURCHASE_TYPE): Promise<PurchasesStoreProduct[]>;
215
185
  /**
216
186
  * Make a purchase
217
187
  *
@@ -219,8 +189,8 @@ export default class Purchases {
219
189
  * @param {UpgradeInfo} upgradeInfo Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU
220
190
  * and the optional prorationMode.
221
191
  * @param {String} type Optional type of product, can be inapp or subs. Subs by default
222
- * @returns {Promise<{ productIdentifier: string, purchaserInfo:PurchaserInfo }>} A promise of an object containing
223
- * a purchaser info object and a product identifier. Rejections return an error code,
192
+ * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
193
+ * a customer info object and a product identifier. Rejections return an error code,
224
194
  * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will
225
195
  * also be rejected if setup has not been called yet.
226
196
  */
@@ -228,22 +198,22 @@ export default class Purchases {
228
198
  /**
229
199
  * iOS only. Purchase a product applying a given discount.
230
200
  *
231
- * @param {PurchasesProduct} product The product you want to purchase
232
- * @param {PurchasesPaymentDiscount} discount Discount to apply to this package. Retrieve this discount using getPaymentDiscount.
233
- * @returns {Promise<{ productIdentifier: string, purchaserInfo:PurchaserInfo }>} A promise of an object containing
234
- * a purchaser info object and a product identifier. Rejections return an error code,
201
+ * @param {PurchasesStoreProduct} product The product you want to purchase
202
+ * @param {PurchasesPromotionalOffer} discount Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
203
+ * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
204
+ * a customer info object and a product identifier. Rejections return an error code,
235
205
  * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be
236
206
  * rejected if setup has not been called yet.
237
207
  */
238
- static purchaseDiscountedProduct(product: PurchasesProduct, discount: PurchasesPaymentDiscount): Promise<MakePurchaseResult>;
208
+ static purchaseDiscountedProduct(product: PurchasesStoreProduct, discount: PurchasesPromotionalOffer): Promise<MakePurchaseResult>;
239
209
  /**
240
210
  * Make a purchase
241
211
  *
242
212
  * @param {PurchasesPackage} aPackage The Package you wish to purchase. You can get the Packages by calling getOfferings
243
213
  * @param {UpgradeInfo} upgradeInfo Android only. Optional UpgradeInfo you wish to upgrade from containing the oldSKU
244
214
  * and the optional prorationMode.
245
- * @returns {Promise<{ productIdentifier: string, purchaserInfo: PurchaserInfo }>} A promise of an object containing
246
- * a purchaser info object and a product identifier. Rejections return an error code, a boolean indicating if the
215
+ * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
216
+ * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
247
217
  * user cancelled the purchase, and an object with more information. The promise will be also be rejected if setup
248
218
  * has not been called yet.
249
219
  */
@@ -252,19 +222,19 @@ export default class Purchases {
252
222
  * iOS only. Purchase a package applying a given discount.
253
223
  *
254
224
  * @param {PurchasesPackage} aPackage The Package you wish to purchase. You can get the Packages by calling getOfferings
255
- * @param {PurchasesPaymentDiscount} discount Discount to apply to this package. Retrieve this discount using getPaymentDiscount.
256
- * @returns {Promise<{ productIdentifier: string, purchaserInfo: PurchaserInfo }>} A promise of an object containing
257
- * a purchaser info object and a product identifier. Rejections return an error code, a boolean indicating if the
225
+ * @param {PurchasesPromotionalOffer} discount Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
226
+ * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
227
+ * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
258
228
  * user cancelled the purchase, and an object with more information. The promise will be also be rejected if setup
259
229
  * has not been called yet.
260
230
  */
261
- static purchaseDiscountedPackage(aPackage: PurchasesPackage, discount: PurchasesPaymentDiscount): Promise<MakePurchaseResult>;
231
+ static purchaseDiscountedPackage(aPackage: PurchasesPackage, discount: PurchasesPromotionalOffer): Promise<MakePurchaseResult>;
262
232
  /**
263
233
  * Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
264
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and an
234
+ * @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
265
235
  * userInfo object with more information. The promise will be also be rejected if setup has not been called yet.
266
236
  */
267
- static restoreTransactions(): Promise<PurchaserInfo>;
237
+ static restoreTransactions(): Promise<CustomerInfo>;
268
238
  /**
269
239
  * Get the appUserID
270
240
  * @returns {Promise<string>} The app user id in a promise
@@ -274,59 +244,30 @@ export default class Purchases {
274
244
  * This function will logIn the current user with an appUserID. Typically this would be used after a log in
275
245
  * to identify a user without calling configure.
276
246
  * @param {String} appUserID The appUserID that should be linked to the currently user
277
- * @returns {Promise<LogInResult>} A promise of an object that contains the purchaserInfo after logging in, as well
247
+ * @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well
278
248
  * as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The
279
249
  * promise will be rejected if setup has not been called yet or if there's an issue logging in.
280
250
  */
281
251
  static logIn(appUserID: string): Promise<LogInResult>;
282
252
  /**
283
253
  * Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
284
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code,
254
+ * @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code,
285
255
  * and a userInfo object with more information. The promise will be rejected if setup has not been called yet or if
286
256
  * there's an issue logging out.
287
257
  */
288
- static logOut(): Promise<PurchaserInfo>;
289
- /**
290
- * @deprecated, use logIn instead.
291
- * This function will alias two appUserIDs together.
292
- * @param {String} newAppUserID The new appUserID that should be linked to the currently identified appUserID.
293
- * Needs to be a string.
294
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and a
295
- * userInfo object with more information. The promise will be rejected if setup has not been called yet or if
296
- * there's an issue creating the alias.
297
- */
298
- static createAlias(newAppUserID: string): Promise<PurchaserInfo>;
299
- /**
300
- * @deprecated, use logIn instead.
301
- * This function will identify the current user with an appUserID. Typically this would be used after a logout to
302
- * identify a new user without calling configure
303
- * @param {String} newAppUserID The appUserID that should be linked to the currently user
304
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and an
305
- * userInfo object with more information. The promise will be rejected if setup has not been called yet or if
306
- * there's an issue identifying the user.
307
- */
308
- static identify(newAppUserID: string): Promise<PurchaserInfo>;
309
- /**
310
- * @deprecated, use logOut instead.
311
- * Resets the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the
312
- * cache.
313
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and an
314
- * userInfo object with more information. The promise will be rejected if setup has not been called yet or if
315
- * there's an issue resetting the user.
316
- */
317
- static reset(): Promise<PurchaserInfo>;
258
+ static logOut(): Promise<CustomerInfo>;
318
259
  /**
319
260
  * Enables/Disables debugs logs
320
261
  * @param {boolean} enabled Enable or not debug logs
321
262
  */
322
263
  static setDebugLogsEnabled(enabled: boolean): Promise<void>;
323
264
  /**
324
- * Gets current purchaser info
325
- * @returns {Promise<PurchaserInfo>} A promise of a purchaser info object. Rejections return an error code, and an
265
+ * Gets current customer info
266
+ * @returns {Promise<CustomerInfo>} A promise of a customer info object. Rejections return an error code, and an
326
267
  * userInfo object with more information. The promise will be rejected if setup has not been called yet or if
327
- * there's an issue getting the purchaser information.
268
+ * there's an issue getting the customer information.
328
269
  */
329
- static getPurchaserInfo(): Promise<PurchaserInfo>;
270
+ static getCustomerInfo(): Promise<CustomerInfo>;
330
271
  /**
331
272
  * This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation
332
273
  * for subscriptions anytime a sync is needed, like after a successful purchase.
@@ -366,28 +307,28 @@ export default class Purchases {
366
307
  [productId: string]: IntroEligibility;
367
308
  }>;
368
309
  /**
369
- * iOS only. Use this function to retrieve the `PurchasesPaymentDiscount` for a given `PurchasesPackage`.
310
+ * iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.
370
311
  *
371
312
  * @param product The `PurchasesProduct` the user intends to purchase.
372
313
  * @param discount The `PurchasesDiscount` to apply to the product.
373
- * @returns { Promise<PurchasesPaymentDiscount> } Returns when the `PurchasesPaymentDiscount` is returned.
314
+ * @returns { Promise<PurchasesPromotionalOffer> } Returns when the `PurchasesPaymentDiscount` is returned.
374
315
  * Null is returned for Android and incompatible iOS versions. The promise will be rejected if setup has not been
375
316
  * called yet or if there's an error getting the payment discount.
376
317
  */
377
- static getPaymentDiscount(product: PurchasesProduct, discount: PurchasesDiscount): Promise<PurchasesPaymentDiscount | undefined>;
318
+ static getPromotionalOffer(product: PurchasesStoreProduct, discount: PurchasesStoreProductDiscount): Promise<PurchasesPromotionalOffer | undefined>;
378
319
  /**
379
- * Invalidates the cache for purchaser information.
320
+ * Invalidates the cache for customer information.
380
321
  *
381
322
  * Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
382
- * Refer to https://docs.revenuecat.com/docs/purchaserinfo#section-get-user-information for more information on
323
+ * Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on
383
324
  * using the cache properly.
384
325
  *
385
- * This is useful for cases where purchaser information might have been updated outside of the app, like if a
326
+ * This is useful for cases where customer information might have been updated outside of the app, like if a
386
327
  * promotional subscription is granted through the RevenueCat dashboard.
387
328
  * @returns {Promise<void>} The promise will be rejected if setup has not been called yet or there's an error
388
- * invalidating the purchaser info cache.
329
+ * invalidating the customer info cache.
389
330
  */
390
- static invalidatePurchaserInfoCache(): Promise<void>;
331
+ static invalidateCustomerInfoCache(): Promise<void>;
391
332
  /** iOS only. Presents a code redemption sheet, useful for redeeming offer codes
392
333
  * Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
393
334
  * to configure and use offer codes
@@ -565,9 +506,9 @@ export default class Purchases {
565
506
  * Note: Billing features are only relevant to Google Play Android users.
566
507
  * For other stores and platforms, billing features won't be checked.
567
508
  *
568
- * @param feature An array of feature types to check for support. Feature types must be one of
509
+ * @param features An array of feature types to check for support. Feature types must be one of
569
510
  * [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.
570
- * @returns {Promise<Boolean>} promise with boolean response. True if billing is supported, false otherwise.
511
+ * @returns {Promise<boolean>} promise with boolean response. True if billing is supported, false otherwise.
571
512
  */
572
513
  static canMakePayments(features?: BILLING_FEATURE[]): Promise<boolean>;
573
514
  /**