@revenuecat/purchases-capacitor 6.0.0-beta.1

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/README.md ADDED
@@ -0,0 +1,1446 @@
1
+ <h3 align="center">😻 In-App Subscriptions Made Easy 😻</h3>
2
+
3
+ [![License](https://img.shields.io/github/license/RevenueCat/purchases-capacitor.svg?style=flat)](https://github.com/RevenueCat/purchases-capacitor/blob/main/LICENSE)
4
+ [![Release](https://img.shields.io/github/release/RevenueCat/purchases-capacitor.svg?style=flat)](https://github.com/RevenueCat/purchases-capacitor/releases)
5
+
6
+ RevenueCat is a powerful, reliable, and free to use in-app purchase server with cross-platform support. Our open-source framework provides a backend and a wrapper around StoreKit and Google Play Billing to make implementing in-app purchases and subscriptions easy.
7
+
8
+ Whether you are building a new app or already have millions of customers, you can use RevenueCat to:
9
+
10
+ * Fetch products, make purchases, and check subscription status with our [native SDKs](https://docs.revenuecat.com/docs/installation).
11
+ * Host and [configure products](https://docs.revenuecat.com/docs/entitlements) remotely from our dashboard.
12
+ * Analyze the most important metrics for your app business [in one place](https://docs.revenuecat.com/docs/charts).
13
+ * See customer transaction histories, chart lifetime value, and [grant promotional subscriptions](https://docs.revenuecat.com/docs/customers).
14
+ * Get notified of real-time events through [webhooks](https://docs.revenuecat.com/docs/webhooks).
15
+ * Send enriched purchase events to analytics and attribution tools with our easy integrations.
16
+
17
+ Sign up to [get started for free](https://app.revenuecat.com/signup).
18
+
19
+ ## @revenucat/purchases-capacitor
20
+
21
+ *@revenuecat/purchases-capacitor* is the client for the [RevenueCat](https://www.revenuecat.com/) subscription and purchase tracking system. It is an open source framework that provides a wrapper around StoreKit, Google Play Billing and the RevenueCat backend to make implementing in-app purchases in Capacitor easy.
22
+
23
+ ## RevenueCat SDK Features
24
+ | | RevenueCat |
25
+ |----|--------------------------------------------------------------------------------------------------------------------------------------------------------------|
26
+ | ✅ | Server-side receipt validation |
27
+ | ➡️ | [Webhooks](https://docs.revenuecat.com/docs/webhooks) - enhanced server-to-server communication with events for purchases, renewals, cancellations, and more |
28
+ | 🎯 | Subscription status tracking - know whether a user is subscribed whether they're on iOS, Android or web |
29
+ | 📊 | Analytics - automatic calculation of metrics like conversion, mrr, and churn |
30
+ | 📝 | [Online documentation](https://docs.revenuecat.com/docs) up to date |
31
+ | 🔀 | [Integrations](https://www.revenuecat.com/integrations) - over a dozen integrations to easily send purchase data where you need it |
32
+ | 💯 | Well maintained - [frequent releases](https://github.com/RevenueCat/purchases-capacitor/releases) |
33
+ | 📮 | Great support - [Help Center](https://revenuecat.zendesk.com) |
34
+
35
+ ## Getting Started
36
+ For more detailed information, you can view our complete documentation at [docs.revenuecat.com](https://docs.revenuecat.com/docs).
37
+
38
+ Please follow the [Quickstart Guide](https://docs.revenuecat.com/docs/) for more information on how to install the SDK.
39
+
40
+ ```bash
41
+ npm install @revenuecat/purchases-capacitor
42
+ npx cap sync
43
+ ```
44
+
45
+ ## Contributing
46
+ Contributions are always welcome! To learn how you can contribute, please see the [Contributing Guide](./CONTRIBUTING.md).
47
+
48
+ ## Acknowledgment
49
+
50
+ This plugin is based on [CapGo's Capacitor plugin](https://www.npmjs.com/package/@capgo/capacitor-purchases). The plugin was transferred to RevenueCat to become an officially supported plugin.
51
+
52
+ ## API
53
+
54
+ <docgen-index>
55
+
56
+ * [`configure(...)`](#configure)
57
+ * [`setFinishTransactions(...)`](#setfinishtransactions)
58
+ * [`setSimulatesAskToBuyInSandbox(...)`](#setsimulatesasktobuyinsandbox)
59
+ * [`addCustomerInfoUpdateListener(...)`](#addcustomerinfoupdatelistener)
60
+ * [`removeCustomerInfoUpdateListener(...)`](#removecustomerinfoupdatelistener)
61
+ * [`getOfferings()`](#getofferings)
62
+ * [`getProducts(...)`](#getproducts)
63
+ * [`purchaseStoreProduct(...)`](#purchasestoreproduct)
64
+ * [`purchaseDiscountedProduct(...)`](#purchasediscountedproduct)
65
+ * [`purchasePackage(...)`](#purchasepackage)
66
+ * [`purchaseSubscriptionOption(...)`](#purchasesubscriptionoption)
67
+ * [`purchaseDiscountedPackage(...)`](#purchasediscountedpackage)
68
+ * [`restorePurchases()`](#restorepurchases)
69
+ * [`getAppUserID()`](#getappuserid)
70
+ * [`logIn(...)`](#login)
71
+ * [`logOut()`](#logout)
72
+ * [`setLogLevel(...)`](#setloglevel)
73
+ * [`setLogHandler(...)`](#setloghandler)
74
+ * [`getCustomerInfo()`](#getcustomerinfo)
75
+ * [`syncPurchases()`](#syncpurchases)
76
+ * [`syncObserverModeAmazonPurchase(...)`](#syncobservermodeamazonpurchase)
77
+ * [`enableAdServicesAttributionTokenCollection()`](#enableadservicesattributiontokencollection)
78
+ * [`isAnonymous()`](#isanonymous)
79
+ * [`checkTrialOrIntroductoryPriceEligibility(...)`](#checktrialorintroductorypriceeligibility)
80
+ * [`getPromotionalOffer(...)`](#getpromotionaloffer)
81
+ * [`invalidateCustomerInfoCache()`](#invalidatecustomerinfocache)
82
+ * [`presentCodeRedemptionSheet()`](#presentcoderedemptionsheet)
83
+ * [`setAttributes(...)`](#setattributes)
84
+ * [`setEmail(...)`](#setemail)
85
+ * [`setPhoneNumber(...)`](#setphonenumber)
86
+ * [`setDisplayName(...)`](#setdisplayname)
87
+ * [`setPushToken(...)`](#setpushtoken)
88
+ * [`setProxyURL(...)`](#setproxyurl)
89
+ * [`collectDeviceIdentifiers()`](#collectdeviceidentifiers)
90
+ * [`setAdjustID(...)`](#setadjustid)
91
+ * [`setAppsflyerID(...)`](#setappsflyerid)
92
+ * [`setFBAnonymousID(...)`](#setfbanonymousid)
93
+ * [`setMparticleID(...)`](#setmparticleid)
94
+ * [`setCleverTapID(...)`](#setclevertapid)
95
+ * [`setMixpanelDistinctID(...)`](#setmixpaneldistinctid)
96
+ * [`setFirebaseAppInstanceID(...)`](#setfirebaseappinstanceid)
97
+ * [`setOnesignalID(...)`](#setonesignalid)
98
+ * [`setAirshipChannelID(...)`](#setairshipchannelid)
99
+ * [`setMediaSource(...)`](#setmediasource)
100
+ * [`setCampaign(...)`](#setcampaign)
101
+ * [`setAdGroup(...)`](#setadgroup)
102
+ * [`setAd(...)`](#setad)
103
+ * [`setKeyword(...)`](#setkeyword)
104
+ * [`setCreative(...)`](#setcreative)
105
+ * [`canMakePayments(...)`](#canmakepayments)
106
+ * [`beginRefundRequestForActiveEntitlement()`](#beginrefundrequestforactiveentitlement)
107
+ * [`beginRefundRequestForEntitlement(...)`](#beginrefundrequestforentitlement)
108
+ * [`beginRefundRequestForProduct(...)`](#beginrefundrequestforproduct)
109
+ * [`isConfigured()`](#isconfigured)
110
+ * [Interfaces](#interfaces)
111
+ * [Type Aliases](#type-aliases)
112
+ * [Enums](#enums)
113
+
114
+ </docgen-index>
115
+
116
+ <docgen-api>
117
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
118
+
119
+ ### configure(...)
120
+
121
+ ```typescript
122
+ configure(configuration: PurchasesConfiguration) => Promise<void>
123
+ ```
124
+
125
+ Sets up Purchases with your API key and an app user id.
126
+
127
+ | Param | Type | Description |
128
+ | ------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
129
+ | **`configuration`** | <code><a href="#purchasesconfiguration">PurchasesConfiguration</a></code> | RevenueCat configuration object including the API key and other optional parameters. See {@link <a href="#purchasesconfiguration">PurchasesConfiguration</a>} |
130
+
131
+ --------------------
132
+
133
+
134
+ ### setFinishTransactions(...)
135
+
136
+ ```typescript
137
+ setFinishTransactions(options: { finishTransactions: boolean; }) => Promise<void>
138
+ ```
139
+
140
+ | Param | Type | Description |
141
+ | ------------- | --------------------------------------------- | -------------------------------------------------------------------------------------- |
142
+ | **`options`** | <code>{ finishTransactions: boolean; }</code> | Set finishTransactions to false if you aren't using Purchases SDK to make the purchase |
143
+
144
+ --------------------
145
+
146
+
147
+ ### setSimulatesAskToBuyInSandbox(...)
148
+
149
+ ```typescript
150
+ setSimulatesAskToBuyInSandbox(options: { simulatesAskToBuyInSandbox: boolean; }) => Promise<void>
151
+ ```
152
+
153
+ iOS only.
154
+
155
+ | Param | Type | Description |
156
+ | ------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
157
+ | **`options`** | <code>{ simulatesAskToBuyInSandbox: boolean; }</code> | Set this property to true *only* when testing the ask-to-buy / SCA purchases flow. More information: http://errors.rev.cat/ask-to-buy |
158
+
159
+ --------------------
160
+
161
+
162
+ ### addCustomerInfoUpdateListener(...)
163
+
164
+ ```typescript
165
+ addCustomerInfoUpdateListener(customerInfoUpdateListener: CustomerInfoUpdateListener) => Promise<PurchasesCallbackId>
166
+ ```
167
+
168
+ Sets a function to be called on updated customer info
169
+
170
+ | Param | Type | Description |
171
+ | -------------------------------- | --------------------------------------------------------------------------------- | -------------------------------------------------------- |
172
+ | **`customerInfoUpdateListener`** | <code><a href="#customerinfoupdatelistener">CustomerInfoUpdateListener</a></code> | <a href="#customerinfo">CustomerInfo</a> update listener |
173
+
174
+ **Returns:** <code>Promise&lt;string&gt;</code>
175
+
176
+ --------------------
177
+
178
+
179
+ ### removeCustomerInfoUpdateListener(...)
180
+
181
+ ```typescript
182
+ removeCustomerInfoUpdateListener(listenerToRemove: PurchasesCallbackId) => Promise<{ wasRemoved: boolean; }>
183
+ ```
184
+
185
+ Removes a given <a href="#customerinfoupdatelistener">CustomerInfoUpdateListener</a>
186
+
187
+ | Param | Type | Description |
188
+ | ---------------------- | ------------------- | -------------------------------------------------------------------------------------------------------- |
189
+ | **`listenerToRemove`** | <code>string</code> | <a href="#customerinfoupdatelistener">CustomerInfoUpdateListener</a> reference of the listener to remove |
190
+
191
+ **Returns:** <code>Promise&lt;{ wasRemoved: boolean; }&gt;</code>
192
+
193
+ --------------------
194
+
195
+
196
+ ### getOfferings()
197
+
198
+ ```typescript
199
+ getOfferings() => Promise<PurchasesOfferings>
200
+ ```
201
+
202
+ Gets the map of entitlements -&gt; offerings -&gt; products
203
+
204
+ **Returns:** <code>Promise&lt;<a href="#purchasesofferings">PurchasesOfferings</a>&gt;</code>
205
+
206
+ --------------------
207
+
208
+
209
+ ### getProducts(...)
210
+
211
+ ```typescript
212
+ getProducts(options: GetProductOptions) => Promise<{ products: PurchasesStoreProduct[]; }>
213
+ ```
214
+
215
+ Fetch the product info
216
+
217
+ | Param | Type |
218
+ | ------------- | --------------------------------------------------------------- |
219
+ | **`options`** | <code><a href="#getproductoptions">GetProductOptions</a></code> |
220
+
221
+ **Returns:** <code>Promise&lt;{ products: PurchasesStoreProduct[]; }&gt;</code>
222
+
223
+ --------------------
224
+
225
+
226
+ ### purchaseStoreProduct(...)
227
+
228
+ ```typescript
229
+ purchaseStoreProduct(options: PurchaseStoreProductOptions) => Promise<MakePurchaseResult>
230
+ ```
231
+
232
+ Make a purchase
233
+
234
+ | Param | Type |
235
+ | ------------- | ----------------------------------------------------------------------------------- |
236
+ | **`options`** | <code><a href="#purchasestoreproductoptions">PurchaseStoreProductOptions</a></code> |
237
+
238
+ **Returns:** <code>Promise&lt;<a href="#makepurchaseresult">MakePurchaseResult</a>&gt;</code>
239
+
240
+ --------------------
241
+
242
+
243
+ ### purchaseDiscountedProduct(...)
244
+
245
+ ```typescript
246
+ purchaseDiscountedProduct(options: PurchaseDiscountedProductOptions) => Promise<MakePurchaseResult>
247
+ ```
248
+
249
+ iOS only. Purchase a product applying a given discount.
250
+
251
+ | Param | Type |
252
+ | ------------- | --------------------------------------------------------------------------------------------- |
253
+ | **`options`** | <code><a href="#purchasediscountedproductoptions">PurchaseDiscountedProductOptions</a></code> |
254
+
255
+ **Returns:** <code>Promise&lt;<a href="#makepurchaseresult">MakePurchaseResult</a>&gt;</code>
256
+
257
+ --------------------
258
+
259
+
260
+ ### purchasePackage(...)
261
+
262
+ ```typescript
263
+ purchasePackage(options: PurchasePackageOptions) => Promise<MakePurchaseResult>
264
+ ```
265
+
266
+ Make a purchase
267
+
268
+ | Param | Type |
269
+ | ------------- | ------------------------------------------------------------------------- |
270
+ | **`options`** | <code><a href="#purchasepackageoptions">PurchasePackageOptions</a></code> |
271
+
272
+ **Returns:** <code>Promise&lt;<a href="#makepurchaseresult">MakePurchaseResult</a>&gt;</code>
273
+
274
+ --------------------
275
+
276
+
277
+ ### purchaseSubscriptionOption(...)
278
+
279
+ ```typescript
280
+ purchaseSubscriptionOption(options: PurchaseSubscriptionOptionOptions) => Promise<MakePurchaseResult>
281
+ ```
282
+
283
+ Google only. Make a purchase of a subscriptionOption
284
+
285
+ | Param | Type |
286
+ | ------------- | ----------------------------------------------------------------------------------------------- |
287
+ | **`options`** | <code><a href="#purchasesubscriptionoptionoptions">PurchaseSubscriptionOptionOptions</a></code> |
288
+
289
+ **Returns:** <code>Promise&lt;<a href="#makepurchaseresult">MakePurchaseResult</a>&gt;</code>
290
+
291
+ --------------------
292
+
293
+
294
+ ### purchaseDiscountedPackage(...)
295
+
296
+ ```typescript
297
+ purchaseDiscountedPackage(options: PurchaseDiscountedPackageOptions) => Promise<MakePurchaseResult>
298
+ ```
299
+
300
+ iOS only. Purchase a package applying a given discount.
301
+
302
+ | Param | Type |
303
+ | ------------- | --------------------------------------------------------------------------------------------- |
304
+ | **`options`** | <code><a href="#purchasediscountedpackageoptions">PurchaseDiscountedPackageOptions</a></code> |
305
+
306
+ **Returns:** <code>Promise&lt;<a href="#makepurchaseresult">MakePurchaseResult</a>&gt;</code>
307
+
308
+ --------------------
309
+
310
+
311
+ ### restorePurchases()
312
+
313
+ ```typescript
314
+ restorePurchases() => Promise<{ customerInfo: CustomerInfo; }>
315
+ ```
316
+
317
+ Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
318
+
319
+ **Returns:** <code>Promise&lt;{ customerInfo: <a href="#customerinfo">CustomerInfo</a>; }&gt;</code>
320
+
321
+ --------------------
322
+
323
+
324
+ ### getAppUserID()
325
+
326
+ ```typescript
327
+ getAppUserID() => Promise<{ appUserID: string; }>
328
+ ```
329
+
330
+ Get the appUserID
331
+
332
+ **Returns:** <code>Promise&lt;{ appUserID: string; }&gt;</code>
333
+
334
+ --------------------
335
+
336
+
337
+ ### logIn(...)
338
+
339
+ ```typescript
340
+ logIn(options: { appUserID: string; }) => Promise<LogInResult>
341
+ ```
342
+
343
+ This function will log in the current user with an appUserID. Typically, this would be used after a log in
344
+ to identify a user without calling configure.
345
+
346
+ | Param | Type | Description |
347
+ | ------------- | ----------------------------------- | ------------------------------------------------------- |
348
+ | **`options`** | <code>{ appUserID: string; }</code> | The appUserID that should be linked to the current user |
349
+
350
+ **Returns:** <code>Promise&lt;<a href="#loginresult">LogInResult</a>&gt;</code>
351
+
352
+ --------------------
353
+
354
+
355
+ ### logOut()
356
+
357
+ ```typescript
358
+ logOut() => Promise<{ customerInfo: CustomerInfo; }>
359
+ ```
360
+
361
+ Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
362
+
363
+ **Returns:** <code>Promise&lt;{ customerInfo: <a href="#customerinfo">CustomerInfo</a>; }&gt;</code>
364
+
365
+ --------------------
366
+
367
+
368
+ ### setLogLevel(...)
369
+
370
+ ```typescript
371
+ setLogLevel(options: { level: LOG_LEVEL; }) => Promise<void>
372
+ ```
373
+
374
+ Used to set the log level. Useful for debugging issues with the lovely team @RevenueCat.
375
+ The default is {<a href="#log_level">LOG_LEVEL.INFO</a>} in release builds and {<a href="#log_level">LOG_LEVEL.DEBUG</a>} in debug builds.
376
+
377
+ | Param | Type | Description |
378
+ | ------------- | ----------------------------------------------------------- | --------------------------------- |
379
+ | **`options`** | <code>{ level: <a href="#log_level">LOG_LEVEL</a>; }</code> | Log level to use to display logs. |
380
+
381
+ --------------------
382
+
383
+
384
+ ### setLogHandler(...)
385
+
386
+ ```typescript
387
+ setLogHandler(logHandler: LogHandler) => Promise<void>
388
+ ```
389
+
390
+ Set a custom log handler for redirecting logs to your own logging system.
391
+ By default, this sends info, warning, and error messages.
392
+ If you wish to receive Debug level messages, see [setLogLevel].
393
+
394
+ | Param | Type | Description |
395
+ | ---------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
396
+ | **`logHandler`** | <code><a href="#loghandler">LogHandler</a></code> | It will get called for each log event. Use this function to redirect the log to your own logging system |
397
+
398
+ --------------------
399
+
400
+
401
+ ### getCustomerInfo()
402
+
403
+ ```typescript
404
+ getCustomerInfo() => Promise<{ customerInfo: CustomerInfo; }>
405
+ ```
406
+
407
+ Gets current customer info
408
+
409
+ **Returns:** <code>Promise&lt;{ customerInfo: <a href="#customerinfo">CustomerInfo</a>; }&gt;</code>
410
+
411
+ --------------------
412
+
413
+
414
+ ### syncPurchases()
415
+
416
+ ```typescript
417
+ syncPurchases() => Promise<void>
418
+ ```
419
+
420
+ This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation
421
+ for subscriptions anytime a sync is needed, like after a successful purchase.
422
+
423
+ --------------------
424
+
425
+
426
+ ### syncObserverModeAmazonPurchase(...)
427
+
428
+ ```typescript
429
+ syncObserverModeAmazonPurchase(options: SyncObserverModeAmazonPurchaseOptions) => Promise<void>
430
+ ```
431
+
432
+ This method will send a purchase to the RevenueCat backend. This function should only be called if you are
433
+ in Amazon observer mode or performing a client side migration of your current users to RevenueCat.
434
+
435
+ The receipt IDs are cached if successfully posted, so they are not posted more than once.
436
+
437
+ | Param | Type |
438
+ | ------------- | ------------------------------------------------------------------------------------------------------- |
439
+ | **`options`** | <code><a href="#syncobservermodeamazonpurchaseoptions">SyncObserverModeAmazonPurchaseOptions</a></code> |
440
+
441
+ --------------------
442
+
443
+
444
+ ### enableAdServicesAttributionTokenCollection()
445
+
446
+ ```typescript
447
+ enableAdServicesAttributionTokenCollection() => Promise<void>
448
+ ```
449
+
450
+ Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default. Supported in iOS 14.3+ only
451
+
452
+ --------------------
453
+
454
+
455
+ ### isAnonymous()
456
+
457
+ ```typescript
458
+ isAnonymous() => Promise<{ isAnonymous: boolean; }>
459
+ ```
460
+
461
+ **Returns:** <code>Promise&lt;{ isAnonymous: boolean; }&gt;</code>
462
+
463
+ --------------------
464
+
465
+
466
+ ### checkTrialOrIntroductoryPriceEligibility(...)
467
+
468
+ ```typescript
469
+ checkTrialOrIntroductoryPriceEligibility(options: { productIdentifiers: string[]; }) => Promise<{ [productId: string]: IntroEligibility; }>
470
+ ```
471
+
472
+ iOS only. Computes whether a user is eligible for the introductory pricing period of a given product.
473
+ You should use this method to determine whether you show the user the normal product price or the
474
+ introductory price. This also applies to trials (trials are considered a type of introductory pricing).
475
+
476
+ | Param | Type | Description |
477
+ | ------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
478
+ | **`options`** | <code>{ productIdentifiers: string[]; }</code> | Array of product identifiers for which you want to compute eligibility |
479
+
480
+ **Returns:** <code>Promise&lt;{ [productId: string]: <a href="#introeligibility">IntroEligibility</a>; }&gt;</code>
481
+
482
+ --------------------
483
+
484
+
485
+ ### getPromotionalOffer(...)
486
+
487
+ ```typescript
488
+ getPromotionalOffer(options: GetPromotionalOfferOptions) => Promise<PurchasesPromotionalOffer | undefined>
489
+ ```
490
+
491
+ iOS only. Use this function to retrieve the <a href="#purchasespromotionaloffer">`PurchasesPromotionalOffer`</a> for a given <a href="#purchasespackage">`PurchasesPackage`</a>.
492
+
493
+ | Param | Type |
494
+ | ------------- | --------------------------------------------------------------------------------- |
495
+ | **`options`** | <code><a href="#getpromotionalofferoptions">GetPromotionalOfferOptions</a></code> |
496
+
497
+ **Returns:** <code>Promise&lt;<a href="#purchasespromotionaloffer">PurchasesPromotionalOffer</a>&gt;</code>
498
+
499
+ --------------------
500
+
501
+
502
+ ### invalidateCustomerInfoCache()
503
+
504
+ ```typescript
505
+ invalidateCustomerInfoCache() => Promise<void>
506
+ ```
507
+
508
+ Invalidates the cache for customer information.
509
+
510
+ Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
511
+ Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on
512
+ using the cache properly.
513
+
514
+ This is useful for cases where customer information might have been updated outside the app, like if a
515
+ promotional subscription is granted through the RevenueCat dashboard.
516
+
517
+ --------------------
518
+
519
+
520
+ ### presentCodeRedemptionSheet()
521
+
522
+ ```typescript
523
+ presentCodeRedemptionSheet() => Promise<void>
524
+ ```
525
+
526
+ iOS 14.0+ only. Presents a code redemption sheet, useful for redeeming offer codes
527
+ Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
528
+ to configure and use offer codes
529
+
530
+ --------------------
531
+
532
+
533
+ ### setAttributes(...)
534
+
535
+ ```typescript
536
+ setAttributes(attributes: { [key: string]: string | null; }) => Promise<void>
537
+ ```
538
+
539
+ Subscriber attributes are useful for storing additional, structured information on a user.
540
+ Since attributes are writable using a public key they should not be used for
541
+ managing secure or sensitive information such as subscription status, coins, etc.
542
+
543
+ Key names starting with "$" are reserved names used by RevenueCat. For a full list of key
544
+ restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
545
+
546
+ | Param | Type | Description |
547
+ | ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------- |
548
+ | **`attributes`** | <code>{ [key: string]: string \| null; }</code> | Map of attributes by key. Set the value as an empty string to delete an attribute. |
549
+
550
+ --------------------
551
+
552
+
553
+ ### setEmail(...)
554
+
555
+ ```typescript
556
+ setEmail(options: { email: string | null; }) => Promise<void>
557
+ ```
558
+
559
+ Subscriber attribute associated with the email address for the user
560
+
561
+ | Param | Type | Description |
562
+ | ------------- | --------------------------------------- | ---------------------------------------------------------- |
563
+ | **`options`** | <code>{ email: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
564
+
565
+ --------------------
566
+
567
+
568
+ ### setPhoneNumber(...)
569
+
570
+ ```typescript
571
+ setPhoneNumber(options: { phoneNumber: string | null; }) => Promise<void>
572
+ ```
573
+
574
+ Subscriber attribute associated with the phone number for the user
575
+
576
+ | Param | Type | Description |
577
+ | ------------- | --------------------------------------------- | ---------------------------------------------------------- |
578
+ | **`options`** | <code>{ phoneNumber: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
579
+
580
+ --------------------
581
+
582
+
583
+ ### setDisplayName(...)
584
+
585
+ ```typescript
586
+ setDisplayName(options: { displayName: string | null; }) => Promise<void>
587
+ ```
588
+
589
+ Subscriber attribute associated with the display name for the user
590
+
591
+ | Param | Type | Description |
592
+ | ------------- | --------------------------------------------- | ---------------------------------------------------------- |
593
+ | **`options`** | <code>{ displayName: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
594
+
595
+ --------------------
596
+
597
+
598
+ ### setPushToken(...)
599
+
600
+ ```typescript
601
+ setPushToken(options: { pushToken: string | null; }) => Promise<void>
602
+ ```
603
+
604
+ Subscriber attribute associated with the push token for the user
605
+
606
+ | Param | Type | Description |
607
+ | ------------- | ------------------------------------------- | ------------------------------------------ |
608
+ | **`options`** | <code>{ pushToken: string \| null; }</code> | null will delete the subscriber attribute. |
609
+
610
+ --------------------
611
+
612
+
613
+ ### setProxyURL(...)
614
+
615
+ ```typescript
616
+ setProxyURL(options: { url: string; }) => Promise<void>
617
+ ```
618
+
619
+ Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value
620
+ from your RevenueCat contact.
621
+
622
+ | Param | Type |
623
+ | ------------- | ----------------------------- |
624
+ | **`options`** | <code>{ url: string; }</code> |
625
+
626
+ --------------------
627
+
628
+
629
+ ### collectDeviceIdentifiers()
630
+
631
+ ```typescript
632
+ collectDeviceIdentifiers() => Promise<void>
633
+ ```
634
+
635
+ Automatically collect subscriber attributes associated with the device identifiers.
636
+ $idfa, $idfv, $ip on iOS
637
+ $gpsAdId, $androidId, $ip on Android
638
+
639
+ --------------------
640
+
641
+
642
+ ### setAdjustID(...)
643
+
644
+ ```typescript
645
+ setAdjustID(options: { adjustID: string | null; }) => Promise<void>
646
+ ```
647
+
648
+ Subscriber attribute associated with the Adjust ID for the user
649
+ Required for the RevenueCat Adjust integration
650
+
651
+ | Param | Type | Description |
652
+ | ------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------- |
653
+ | **`options`** | <code>{ adjustID: string \| null; }</code> | Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute. |
654
+
655
+ --------------------
656
+
657
+
658
+ ### setAppsflyerID(...)
659
+
660
+ ```typescript
661
+ setAppsflyerID(options: { appsflyerID: string | null; }) => Promise<void>
662
+ ```
663
+
664
+ Subscriber attribute associated with the AppsFlyer ID for the user
665
+ Required for the RevenueCat AppsFlyer integration
666
+
667
+ | Param | Type | Description |
668
+ | ------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
669
+ | **`options`** | <code>{ appsflyerID: string \| null; }</code> | Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute. |
670
+
671
+ --------------------
672
+
673
+
674
+ ### setFBAnonymousID(...)
675
+
676
+ ```typescript
677
+ setFBAnonymousID(options: { fbAnonymousID: string | null; }) => Promise<void>
678
+ ```
679
+
680
+ Subscriber attribute associated with the Facebook SDK Anonymous ID for the user
681
+ Recommended for the RevenueCat Facebook integration
682
+
683
+ | Param | Type | Description |
684
+ | ------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
685
+ | **`options`** | <code>{ fbAnonymousID: string \| null; }</code> | Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute. |
686
+
687
+ --------------------
688
+
689
+
690
+ ### setMparticleID(...)
691
+
692
+ ```typescript
693
+ setMparticleID(options: { mparticleID: string | null; }) => Promise<void>
694
+ ```
695
+
696
+ Subscriber attribute associated with the mParticle ID for the user
697
+ Recommended for the RevenueCat mParticle integration
698
+
699
+ | Param | Type | Description |
700
+ | ------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
701
+ | **`options`** | <code>{ mparticleID: string \| null; }</code> | Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute. |
702
+
703
+ --------------------
704
+
705
+
706
+ ### setCleverTapID(...)
707
+
708
+ ```typescript
709
+ setCleverTapID(options: { cleverTapID: string | null; }) => Promise<void>
710
+ ```
711
+
712
+ Subscriber attribute associated with the CleverTap ID for the user
713
+ Required for the RevenueCat CleverTap integration
714
+
715
+ | Param | Type | Description |
716
+ | ------------- | --------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
717
+ | **`options`** | <code>{ cleverTapID: string \| null; }</code> | CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute. |
718
+
719
+ --------------------
720
+
721
+
722
+ ### setMixpanelDistinctID(...)
723
+
724
+ ```typescript
725
+ setMixpanelDistinctID(options: { mixpanelDistinctID: string | null; }) => Promise<void>
726
+ ```
727
+
728
+ Subscriber attribute associated with the Mixpanel Distinct ID for the user
729
+ Required for the RevenueCat Mixpanel integration
730
+
731
+ | Param | Type | Description |
732
+ | ------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
733
+ | **`options`** | <code>{ mixpanelDistinctID: string \| null; }</code> | Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute. |
734
+
735
+ --------------------
736
+
737
+
738
+ ### setFirebaseAppInstanceID(...)
739
+
740
+ ```typescript
741
+ setFirebaseAppInstanceID(options: { firebaseAppInstanceID: string | null; }) => Promise<void>
742
+ ```
743
+
744
+ Subscriber attribute associated with the Firebase App Instance ID for the user
745
+ Required for the RevenueCat Firebase integration
746
+
747
+ | Param | Type | Description |
748
+ | ------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
749
+ | **`options`** | <code>{ firebaseAppInstanceID: string \| null; }</code> | Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute. |
750
+
751
+ --------------------
752
+
753
+
754
+ ### setOnesignalID(...)
755
+
756
+ ```typescript
757
+ setOnesignalID(options: { onesignalID: string | null; }) => Promise<void>
758
+ ```
759
+
760
+ Subscriber attribute associated with the OneSignal Player ID for the user
761
+ Required for the RevenueCat OneSignal integration
762
+
763
+ | Param | Type | Description |
764
+ | ------------- | --------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
765
+ | **`options`** | <code>{ onesignalID: string \| null; }</code> | OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute. |
766
+
767
+ --------------------
768
+
769
+
770
+ ### setAirshipChannelID(...)
771
+
772
+ ```typescript
773
+ setAirshipChannelID(options: { airshipChannelID: string | null; }) => Promise<void>
774
+ ```
775
+
776
+ Subscriber attribute associated with the Airship Channel ID for the user
777
+ Required for the RevenueCat Airship integration
778
+
779
+ | Param | Type | Description |
780
+ | ------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
781
+ | **`options`** | <code>{ airshipChannelID: string \| null; }</code> | Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute. |
782
+
783
+ --------------------
784
+
785
+
786
+ ### setMediaSource(...)
787
+
788
+ ```typescript
789
+ setMediaSource(options: { mediaSource: string | null; }) => Promise<void>
790
+ ```
791
+
792
+ Subscriber attribute associated with the install media source for the user
793
+
794
+ | Param | Type | Description |
795
+ | ------------- | --------------------------------------------- | ---------------------------------------------------------- |
796
+ | **`options`** | <code>{ mediaSource: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
797
+
798
+ --------------------
799
+
800
+
801
+ ### setCampaign(...)
802
+
803
+ ```typescript
804
+ setCampaign(options: { campaign: string | null; }) => Promise<void>
805
+ ```
806
+
807
+ Subscriber attribute associated with the install campaign for the user
808
+
809
+ | Param | Type | Description |
810
+ | ------------- | ------------------------------------------ | ---------------------------------------------------------- |
811
+ | **`options`** | <code>{ campaign: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
812
+
813
+ --------------------
814
+
815
+
816
+ ### setAdGroup(...)
817
+
818
+ ```typescript
819
+ setAdGroup(options: { adGroup: string | null; }) => Promise<void>
820
+ ```
821
+
822
+ Subscriber attribute associated with the install ad group for the user
823
+
824
+ | Param | Type | Description |
825
+ | ------------- | ----------------------------------------- | ---------------------------------------------------------- |
826
+ | **`options`** | <code>{ adGroup: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
827
+
828
+ --------------------
829
+
830
+
831
+ ### setAd(...)
832
+
833
+ ```typescript
834
+ setAd(options: { ad: string | null; }) => Promise<void>
835
+ ```
836
+
837
+ Subscriber attribute associated with the install ad for the user
838
+
839
+ | Param | Type | Description |
840
+ | ------------- | ------------------------------------ | ---------------------------------------------------------- |
841
+ | **`options`** | <code>{ ad: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
842
+
843
+ --------------------
844
+
845
+
846
+ ### setKeyword(...)
847
+
848
+ ```typescript
849
+ setKeyword(options: { keyword: string | null; }) => Promise<void>
850
+ ```
851
+
852
+ Subscriber attribute associated with the install keyword for the user
853
+
854
+ | Param | Type | Description |
855
+ | ------------- | ----------------------------------------- | ---------------------------------------------------------- |
856
+ | **`options`** | <code>{ keyword: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
857
+
858
+ --------------------
859
+
860
+
861
+ ### setCreative(...)
862
+
863
+ ```typescript
864
+ setCreative(options: { creative: string | null; }) => Promise<void>
865
+ ```
866
+
867
+ Subscriber attribute associated with the install ad creative for the user
868
+
869
+ | Param | Type | Description |
870
+ | ------------- | ------------------------------------------ | ---------------------------------------------------------- |
871
+ | **`options`** | <code>{ creative: string \| null; }</code> | Empty String or null will delete the subscriber attribute. |
872
+
873
+ --------------------
874
+
875
+
876
+ ### canMakePayments(...)
877
+
878
+ ```typescript
879
+ canMakePayments(options?: { features?: BILLING_FEATURE[] | undefined; } | undefined) => Promise<{ canMakePayments: boolean; }>
880
+ ```
881
+
882
+ Check if billing is supported for the current user (meaning IN-APP purchases are supported)
883
+ and optionally, whether a list of specified feature types are supported.
884
+
885
+ Note: Billing features are only relevant to Google Play Android users.
886
+ For other stores and platforms, billing features won't be checked.
887
+
888
+ | Param | Type | Description |
889
+ | ------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
890
+ | **`options`** | <code>{ features?: BILLING_FEATURE[]; }</code> | An array of feature types to check for support. Feature types must be one of [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked. |
891
+
892
+ **Returns:** <code>Promise&lt;{ canMakePayments: boolean; }&gt;</code>
893
+
894
+ --------------------
895
+
896
+
897
+ ### beginRefundRequestForActiveEntitlement()
898
+
899
+ ```typescript
900
+ beginRefundRequestForActiveEntitlement() => Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS; }>
901
+ ```
902
+
903
+ iOS 15+ only. Presents a refund request sheet in the current window scene for
904
+ the latest transaction associated with the active entitlement.
905
+
906
+ If the request was unsuccessful, no active entitlements could be found for
907
+ the user, or multiple active entitlements were found for the user,
908
+ the promise will return an error.
909
+ If called in an unsupported platform (Android or iOS &lt; 15), an `UnsupportedPlatformException` will be thrown.
910
+
911
+ Important: This method should only be used if your user can only have a single active entitlement at a given time.
912
+ If a user could have more than one entitlement at a time, use `beginRefundRequestForEntitlement` instead.
913
+
914
+ **Returns:** <code>Promise&lt;{ refundRequestStatus: <a href="#refund_request_status">REFUND_REQUEST_STATUS</a>; }&gt;</code>
915
+
916
+ --------------------
917
+
918
+
919
+ ### beginRefundRequestForEntitlement(...)
920
+
921
+ ```typescript
922
+ beginRefundRequestForEntitlement(options: { entitlementInfo: PurchasesEntitlementInfo; }) => Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS; }>
923
+ ```
924
+
925
+ iOS 15+ only. Presents a refund request sheet in the current window scene for
926
+ the latest transaction associated with the `entitlement`.
927
+
928
+ If the request was unsuccessful, the promise will return an error.
929
+ If called in an unsupported platform (Android or iOS &lt; 15), an `UnsupportedPlatformException` will be thrown.
930
+
931
+ | Param | Type | Description |
932
+ | ------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
933
+ | **`options`** | <code>{ entitlementInfo: <a href="#purchasesentitlementinfo">PurchasesEntitlementInfo</a>; }</code> | The entitlement to begin a refund request for. |
934
+
935
+ **Returns:** <code>Promise&lt;{ refundRequestStatus: <a href="#refund_request_status">REFUND_REQUEST_STATUS</a>; }&gt;</code>
936
+
937
+ --------------------
938
+
939
+
940
+ ### beginRefundRequestForProduct(...)
941
+
942
+ ```typescript
943
+ beginRefundRequestForProduct(options: { storeProduct: PurchasesStoreProduct; }) => Promise<{ refundRequestStatus: REFUND_REQUEST_STATUS; }>
944
+ ```
945
+
946
+ iOS 15+ only. Presents a refund request sheet in the current window scene for
947
+ the latest transaction associated with the `product`.
948
+
949
+ If the request was unsuccessful, the promise will return an error.
950
+ If called in an unsupported platform (Android or iOS &lt; 15), an `UnsupportedPlatformException` will be thrown.
951
+
952
+ | Param | Type | Description |
953
+ | ------------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------- |
954
+ | **`options`** | <code>{ storeProduct: <a href="#purchasesstoreproduct">PurchasesStoreProduct</a>; }</code> | The StoreProduct to begin a refund request for. |
955
+
956
+ **Returns:** <code>Promise&lt;{ refundRequestStatus: <a href="#refund_request_status">REFUND_REQUEST_STATUS</a>; }&gt;</code>
957
+
958
+ --------------------
959
+
960
+
961
+ ### isConfigured()
962
+
963
+ ```typescript
964
+ isConfigured() => Promise<{ isConfigured: boolean; }>
965
+ ```
966
+
967
+ Check if configure has finished and Purchases has been configured.
968
+
969
+ **Returns:** <code>Promise&lt;{ isConfigured: boolean; }&gt;</code>
970
+
971
+ --------------------
972
+
973
+
974
+ ### Interfaces
975
+
976
+
977
+ #### PurchasesConfiguration
978
+
979
+ Holds parameters to initialize the SDK.
980
+
981
+ | Prop | Type | Description |
982
+ | ------------------------------ | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
983
+ | **`apiKey`** | <code>string</code> | RevenueCat API Key. Needs to be a string |
984
+ | **`appUserID`** | <code>string \| null</code> | A unique id for identifying the user |
985
+ | **`observerMode`** | <code>boolean</code> | 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. If you are on Android and setting this to ON, you will have to acknowledge the purchases yourself. |
986
+ | **`userDefaultsSuiteName`** | <code>string</code> | An optional string. iOS-only, will be ignored for Android. Set this if you would like the RevenueCat SDK to store its preferences in a different NSUserDefaults suite, otherwise it will use standardUserDefaults. Default is null, which will make the SDK use standardUserDefaults. |
987
+ | **`usesStoreKit2IfAvailable`** | <code>boolean</code> | iOS-only, will be ignored for Android. Set this to TRUE to enable StoreKit2. Default is FALSE. |
988
+ | **`useAmazon`** | <code>boolean</code> | An optional boolean. Android only. Required to configure the plugin to be used in the Amazon Appstore. |
989
+
990
+
991
+ #### CustomerInfo
992
+
993
+ | Prop | Type | Description |
994
+ | ------------------------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
995
+ | **`entitlements`** | <code><a href="#purchasesentitlementinfos">PurchasesEntitlementInfos</a></code> | Entitlements attached to this customer info |
996
+ | **`activeSubscriptions`** | <code>string[]</code> | Set of active subscription skus |
997
+ | **`allPurchasedProductIdentifiers`** | <code>string[]</code> | Set of purchased skus, active and inactive |
998
+ | **`latestExpirationDate`** | <code>string \| null</code> | The latest expiration date of all purchased skus |
999
+ | **`firstSeen`** | <code>string</code> | The date this user was first seen in RevenueCat. |
1000
+ | **`originalAppUserId`** | <code>string</code> | The original App User Id recorded for this user. |
1001
+ | **`requestDate`** | <code>string</code> | Date when this info was requested |
1002
+ | **`allExpirationDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to expiration dates |
1003
+ | **`allPurchaseDates`** | <code>{ [key: string]: string \| null; }</code> | Map of skus to purchase dates |
1004
+ | **`originalApplicationVersion`** | <code>string \| null</code> | Returns the version number for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. This corresponds to the value of CFBundleVersion (in iOS) in the Info.plist file when the purchase was originally made. This is always null in Android |
1005
+ | **`originalPurchaseDate`** | <code>string \| null</code> | Returns the purchase date for the version of the application when the user bought the app. Use this for grandfathering users when migrating to subscriptions. |
1006
+ | **`managementURL`** | <code>string \| null</code> | URL to manage the active subscription of the user. If this user has an active iOS subscription, this will point to the App Store, if the user has an active Play Store subscription it will point there. If there are no active subscriptions it will be null. If there are multiple for different platforms, it will point to the device store. |
1007
+ | **`nonSubscriptionTransactions`** | <code>PurchasesStoreTransaction[]</code> | |
1008
+
1009
+
1010
+ #### PurchasesEntitlementInfos
1011
+
1012
+ Contains all the entitlements associated to the user.
1013
+
1014
+ | Prop | Type | Description |
1015
+ | ------------ | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1016
+ | **`all`** | <code>{ [key: string]: <a href="#purchasesentitlementinfo">PurchasesEntitlementInfo</a>; }</code> | Map of all EntitlementInfo (<a href="#purchasesentitlementinfo">`PurchasesEntitlementInfo`</a>) objects (active and inactive) keyed by entitlement identifier. |
1017
+ | **`active`** | <code>{ [key: string]: <a href="#purchasesentitlementinfo">PurchasesEntitlementInfo</a>; }</code> | Map of active EntitlementInfo (<a href="#purchasesentitlementinfo">`PurchasesEntitlementInfo`</a>) objects keyed by entitlement identifier. |
1018
+
1019
+
1020
+ #### PurchasesEntitlementInfo
1021
+
1022
+ The EntitlementInfo object gives you access to all of the information about the status of a user entitlement.
1023
+
1024
+ | Prop | Type | Description |
1025
+ | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1026
+ | **`identifier`** | <code>string</code> | The entitlement identifier configured in the RevenueCat dashboard |
1027
+ | **`isActive`** | <code>boolean</code> | True if the user has access to this entitlement |
1028
+ | **`willRenew`** | <code>boolean</code> | True if the underlying subscription is set to renew at the end of the billing period (expirationDate). |
1029
+ | **`periodType`** | <code>string</code> | The last period type this entitlement was in. Either: NORMAL, INTRO, TRIAL. |
1030
+ | **`latestPurchaseDate`** | <code>string</code> | The latest purchase or renewal date for the entitlement in ISO8601 format. |
1031
+ | **`latestPurchaseDateMillis`** | <code>number</code> | The latest purchase or renewal date for the entitlement in milliseconds. |
1032
+ | **`originalPurchaseDate`** | <code>string</code> | The first date this entitlement was purchased in ISO8601 format. |
1033
+ | **`originalPurchaseDateMillis`** | <code>number</code> | The first date this entitlement was purchased in milliseconds. |
1034
+ | **`expirationDate`** | <code>string \| null</code> | The expiration date for the entitlement in ISO8601, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1035
+ | **`expirationDateMillis`** | <code>number \| null</code> | The expiration date for the entitlement in milliseconds, can be `null` for lifetime access. If the `periodType` is `trial`, this is the trial expiration date. |
1036
+ | **`store`** | <code>'PLAY_STORE' \| 'APP_STORE' \| 'STRIPE' \| 'MAC_APP_STORE' \| 'PROMOTIONAL' \| 'AMAZON' \| 'UNKNOWN_STORE'</code> | The store where this entitlement was unlocked from. |
1037
+ | **`productIdentifier`** | <code>string</code> | The product identifier that unlocked this entitlement |
1038
+ | **`isSandbox`** | <code>boolean</code> | False if this entitlement is unlocked via a production purchase |
1039
+ | **`unsubscribeDetectedAt`** | <code>string \| null</code> | The date an unsubscribe was detected in ISO8601 format. Can be `null`. |
1040
+ | **`unsubscribeDetectedAtMillis`** | <code>number \| null</code> | The date an unsubscribe was detected in milliseconds. Can be `null`. |
1041
+ | **`billingIssueDetectedAt`** | <code>string \| null</code> | The date a billing issue was detected in ISO8601 format. Can be `null` if there is no billing issue or an issue has been resolved |
1042
+ | **`billingIssueDetectedAtMillis`** | <code>number \| null</code> | The date a billing issue was detected in milliseconds. Can be `null` if there is no billing issue or an issue has been resolved |
1043
+ | **`ownershipType`** | <code>'FAMILY_SHARED' \| 'PURCHASED' \| 'UNKNOWN'</code> | Supported ownership types for an entitlement. PURCHASED if the purchase was made directly by this user. FAMILY_SHARED if the purchase has been shared to this user by a family member. UNKNOWN if the purchase has no or an unknown ownership type. |
1044
+
1045
+
1046
+ #### PurchasesStoreTransaction
1047
+
1048
+ List of all non subscription transactions. Use this to fetch the history of
1049
+ non-subscription purchases
1050
+
1051
+ | Prop | Type | Description |
1052
+ | --------------------------- | ------------------- | ---------------------------------------------------- |
1053
+ | **`transactionIdentifier`** | <code>string</code> | Id of the transaction. |
1054
+ | **`productIdentifier`** | <code>string</code> | Product Id associated with the transaction. |
1055
+ | **`purchaseDate`** | <code>string</code> | Purchase date of the transaction in ISO 8601 format. |
1056
+
1057
+
1058
+ #### PurchasesOfferings
1059
+
1060
+ Contains all the offerings configured in RevenueCat dashboard.
1061
+ For more info see https://docs.revenuecat.com/docs/entitlements
1062
+
1063
+ | Prop | Type | Description |
1064
+ | ------------- | ----------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
1065
+ | **`all`** | <code>{ [key: string]: <a href="#purchasesoffering">PurchasesOffering</a>; }</code> | Map of all Offerings [PurchasesOffering] objects keyed by their identifier. |
1066
+ | **`current`** | <code><a href="#purchasesoffering">PurchasesOffering</a> \| null</code> | Current offering configured in the RevenueCat dashboard. |
1067
+
1068
+
1069
+ #### PurchasesOffering
1070
+
1071
+ An offering is a collection of Packages (<a href="#purchasespackage">`PurchasesPackage`</a>) available for the user to purchase.
1072
+ For more info see https://docs.revenuecat.com/docs/entitlements
1073
+
1074
+ | Prop | Type | Description |
1075
+ | ----------------------- | --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1076
+ | **`identifier`** | <code>string</code> | Unique identifier defined in RevenueCat dashboard. |
1077
+ | **`serverDescription`** | <code>string</code> | Offering description defined in RevenueCat dashboard. |
1078
+ | **`metadata`** | <code>{ [key: string]: unknown; }</code> | Offering metadata defined in RevenueCat dashboard. To access values, you need to check the type beforehand. For example: const my_unknown_value: unknown = offering.metadata['my_key']; const my_string_value: string \| undefined = typeof(my_unknown_value) === 'string' ? my_unknown_value : undefined; |
1079
+ | **`availablePackages`** | <code>PurchasesPackage[]</code> | Array of `Package` objects available for purchase. |
1080
+ | **`lifetime`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Lifetime package type configured in the RevenueCat dashboard, if available. |
1081
+ | **`annual`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Annual package type configured in the RevenueCat dashboard, if available. |
1082
+ | **`sixMonth`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Six month package type configured in the RevenueCat dashboard, if available. |
1083
+ | **`threeMonth`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Three month package type configured in the RevenueCat dashboard, if available. |
1084
+ | **`twoMonth`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Two month package type configured in the RevenueCat dashboard, if available. |
1085
+ | **`monthly`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Monthly package type configured in the RevenueCat dashboard, if available. |
1086
+ | **`weekly`** | <code><a href="#purchasespackage">PurchasesPackage</a> \| null</code> | Weekly package type configured in the RevenueCat dashboard, if available. |
1087
+
1088
+
1089
+ #### PurchasesPackage
1090
+
1091
+ Contains information about the product available for the user to purchase.
1092
+ For more info see https://docs.revenuecat.com/docs/entitlements
1093
+
1094
+ | Prop | Type | Description |
1095
+ | ------------------------ | ----------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
1096
+ | **`identifier`** | <code>string</code> | Unique identifier for this package. Can be one a predefined package type or a custom one. |
1097
+ | **`packageType`** | <code><a href="#package_type">PACKAGE_TYPE</a></code> | Package type for the product. Will be one of [PACKAGE_TYPE]. |
1098
+ | **`product`** | <code><a href="#purchasesstoreproduct">PurchasesStoreProduct</a></code> | Product assigned to this package. |
1099
+ | **`offeringIdentifier`** | <code>string</code> | Offering this package belongs to. |
1100
+
1101
+
1102
+ #### PurchasesStoreProduct
1103
+
1104
+ | Prop | Type | Description |
1105
+ | --------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1106
+ | **`identifier`** | <code>string</code> | Product Id. |
1107
+ | **`description`** | <code>string</code> | Description of the product. |
1108
+ | **`title`** | <code>string</code> | Title of the product. |
1109
+ | **`price`** | <code>number</code> | <a href="#price">Price</a> of the product in the local currency. Contains the price value of defaultOption for Google Play. |
1110
+ | **`priceString`** | <code>string</code> | Formatted price of the item, including its currency sign. Contains the formatted price value of defaultOption for Google Play. |
1111
+ | **`currencyCode`** | <code>string</code> | Currency code for price and original price. Contains the currency code value of defaultOption for Google Play. |
1112
+ | **`introPrice`** | <code><a href="#purchasesintroprice">PurchasesIntroPrice</a> \| null</code> | Introductory price. |
1113
+ | **`discounts`** | <code>PurchasesStoreProductDiscount[] \| null</code> | Collection of discount offers for a product. Null for Android. |
1114
+ | **`productCategory`** | <code><a href="#product_category">PRODUCT_CATEGORY</a> \| null</code> | Product category. |
1115
+ | **`subscriptionPeriod`** | <code>string \| null</code> | Subscription period, specified in ISO 8601 format. For example, P1W equates to one week, P1M equates to one month, P3M equates to three months, P6M equates to six months, and P1Y equates to one year. Note: Not available for Amazon. |
1116
+ | **`defaultOption`** | <code><a href="#subscriptionoption">SubscriptionOption</a> \| null</code> | Default subscription option for a product. Google Play only. |
1117
+ | **`subscriptionOptions`** | <code>SubscriptionOption[] \| null</code> | Collection of subscription options for a product. Google Play only. |
1118
+ | **`presentedOfferingIdentifier`** | <code>string \| null</code> | Offering identifier the store product was presented from. Null if not using offerings or if fetched directly from store via getProducts. |
1119
+
1120
+
1121
+ #### PurchasesIntroPrice
1122
+
1123
+ | Prop | Type | Description |
1124
+ | ------------------------- | ------------------- | ------------------------------------------------------------------------------------------------ |
1125
+ | **`price`** | <code>number</code> | <a href="#price">Price</a> in the local currency. |
1126
+ | **`priceString`** | <code>string</code> | Formatted price, including its currency sign, such as €3.99. |
1127
+ | **`cycles`** | <code>number</code> | Number of subscription billing periods for which the user will be given the discount, such as 3. |
1128
+ | **`period`** | <code>string</code> | Billing period of the discount, specified in ISO 8601 format. |
1129
+ | **`periodUnit`** | <code>string</code> | Unit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR. |
1130
+ | **`periodNumberOfUnits`** | <code>number</code> | Number of units for the billing period of the discount. |
1131
+
1132
+
1133
+ #### PurchasesStoreProductDiscount
1134
+
1135
+ | Prop | Type | Description |
1136
+ | ------------------------- | ------------------- | ------------------------------------------------------------------------------------------------ |
1137
+ | **`identifier`** | <code>string</code> | Identifier of the discount. |
1138
+ | **`price`** | <code>number</code> | <a href="#price">Price</a> in the local currency. |
1139
+ | **`priceString`** | <code>string</code> | Formatted price, including its currency sign, such as €3.99. |
1140
+ | **`cycles`** | <code>number</code> | Number of subscription billing periods for which the user will be given the discount, such as 3. |
1141
+ | **`period`** | <code>string</code> | Billing period of the discount, specified in ISO 8601 format. |
1142
+ | **`periodUnit`** | <code>string</code> | Unit for the billing period of the discount, can be DAY, WEEK, MONTH or YEAR. |
1143
+ | **`periodNumberOfUnits`** | <code>number</code> | Number of units for the billing period of the discount. |
1144
+
1145
+
1146
+ #### SubscriptionOption
1147
+
1148
+ Contains all details associated with a SubscriptionOption
1149
+ Used only for Google
1150
+
1151
+ | Prop | Type | Description |
1152
+ | --------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1153
+ | **`id`** | <code>string</code> | Identifier of the subscription option If this <a href="#subscriptionoption">SubscriptionOption</a> represents a base plan, this will be the basePlanId. If it represents an offer, it will be {basePlanId}:{offerId} |
1154
+ | **`storeProductId`** | <code>string</code> | Identifier of the StoreProduct associated with this SubscriptionOption This will be {subId}:{basePlanId} |
1155
+ | **`productId`** | <code>string</code> | Identifer of the subscription associated with this SubscriptionOption This will be {subId} |
1156
+ | **`pricingPhases`** | <code>PricingPhase[]</code> | Pricing phases defining a user's payment plan for the product over time. |
1157
+ | **`tags`** | <code>string[]</code> | Tags defined on the base plan or offer. Empty for Amazon. |
1158
+ | **`isBasePlan`** | <code>boolean</code> | True if this <a href="#subscriptionoption">SubscriptionOption</a> represents a subscription base plan (rather than an offer). |
1159
+ | **`billingPeriod`** | <code><a href="#period">Period</a> \| null</code> | The subscription period of fullPricePhase (after free and intro trials). |
1160
+ | **`isPrepaid`** | <code>boolean</code> | True if the subscription is pre-paid. |
1161
+ | **`fullPricePhase`** | <code><a href="#pricingphase">PricingPhase</a> \| null</code> | The full price <a href="#pricingphase">PricingPhase</a> of the subscription. Looks for the last price phase of the <a href="#subscriptionoption">SubscriptionOption</a>. |
1162
+ | **`freePhase`** | <code><a href="#pricingphase">PricingPhase</a> \| null</code> | The free trial <a href="#pricingphase">PricingPhase</a> of the subscription. Looks for the first pricing phase of the <a href="#subscriptionoption">SubscriptionOption</a> where amountMicros is 0. There can be a freeTrialPhase and an introductoryPhase in the same <a href="#subscriptionoption">SubscriptionOption</a>. |
1163
+ | **`introPhase`** | <code><a href="#pricingphase">PricingPhase</a> \| null</code> | The intro trial <a href="#pricingphase">PricingPhase</a> of the subscription. Looks for the first pricing phase of the <a href="#subscriptionoption">SubscriptionOption</a> where amountMicros is greater than 0. There can be a freeTrialPhase and an introductoryPhase in the same <a href="#subscriptionoption">SubscriptionOption</a>. |
1164
+ | **`presentedOfferingIdentifier`** | <code>string \| null</code> | Offering identifier the subscription option was presented from |
1165
+
1166
+
1167
+ #### PricingPhase
1168
+
1169
+ Contains all the details associated with a <a href="#pricingphase">PricingPhase</a>
1170
+
1171
+ | Prop | Type | Description |
1172
+ | ----------------------- | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
1173
+ | **`billingPeriod`** | <code><a href="#period">Period</a></code> | Billing period for which the <a href="#pricingphase">PricingPhase</a> applies |
1174
+ | **`recurrenceMode`** | <code><a href="#recurrence_mode">RECURRENCE_MODE</a> \| null</code> | Recurrence mode of the <a href="#pricingphase">PricingPhase</a> |
1175
+ | **`billingCycleCount`** | <code>number \| null</code> | Number of cycles for which the pricing phase applies. Null for infiniteRecurring or finiteRecurring recurrence modes. |
1176
+ | **`price`** | <code><a href="#price">Price</a></code> | <a href="#price">Price</a> of the <a href="#pricingphase">PricingPhase</a> |
1177
+ | **`offerPaymentMode`** | <code><a href="#offer_payment_mode">OFFER_PAYMENT_MODE</a> \| null</code> | Indicates how the pricing phase is charged for finiteRecurring pricing phases |
1178
+
1179
+
1180
+ #### Period
1181
+
1182
+ Contains all the details associated with a <a href="#period">Period</a>
1183
+
1184
+ | Prop | Type | Description |
1185
+ | ------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1186
+ | **`unit`** | <code><a href="#period_unit">PERIOD_UNIT</a></code> | The number of period units: day, week, month, year, unknown |
1187
+ | **`value`** | <code>number</code> | The increment of time that a subscription period is specified in |
1188
+ | **`iso8601`** | <code>string</code> | Specified in ISO 8601 format. For example, P1W equates to one week, P1M equates to one month, P3M equates to three months, P6M equates to six months, and P1Y equates to one year |
1189
+
1190
+
1191
+ #### Price
1192
+
1193
+ Contains all the details associated with a <a href="#price">Price</a>
1194
+
1195
+ | Prop | Type | Description |
1196
+ | ------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1197
+ | **`formatted`** | <code>string</code> | Formatted price of the item, including its currency sign. For example $3.00 |
1198
+ | **`amountMicros`** | <code>number</code> | <a href="#price">Price</a> in micro-units, where 1,000,000 micro-units equal one unit of the currency. For example, if price is "€7.99", price_amount_micros is 7,990,000. This value represents the localized, rounded price for a particular currency. |
1199
+ | **`currencyCode`** | <code>string</code> | Returns ISO 4217 currency code for price and original price. For example, if price is specified in British pounds sterling, price_currency_code is "GBP". If currency code cannot be determined, currency symbol is returned. |
1200
+
1201
+
1202
+ #### GetProductOptions
1203
+
1204
+ | Prop | Type | Description |
1205
+ | ------------------------ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
1206
+ | **`productIdentifiers`** | <code>string[]</code> | Array of product identifiers to obtain |
1207
+ | **`type`** | <code><a href="#product_category">PRODUCT_CATEGORY</a></code> | Optional type of products to fetch, can be SUBSCRIPTION or NON_SUBSCRIPTION. SUBSCRIPTION by default. Ignored in iOS. |
1208
+
1209
+
1210
+ #### PurchaseStoreProductOptions
1211
+
1212
+ | Prop | Type | Description |
1213
+ | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1214
+ | **`product`** | <code><a href="#purchasesstoreproduct">PurchasesStoreProduct</a></code> | The product you want to purchase |
1215
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1216
+ | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1217
+
1218
+
1219
+ #### GoogleProductChangeInfo
1220
+
1221
+ Holds the information used when upgrading from another sku. For Android use only.
1222
+
1223
+ | Prop | Type | Description |
1224
+ | -------------------------- | --------------------------------------------------------- | ------------------------------------------------------------ |
1225
+ | **`oldProductIdentifier`** | <code>string</code> | The old product identifier to upgrade from. |
1226
+ | **`prorationMode`** | <code><a href="#proration_mode">PRORATION_MODE</a></code> | The [PRORATION_MODE] to use when upgrading the given oldSKU. |
1227
+
1228
+
1229
+ #### PurchaseDiscountedProductOptions
1230
+
1231
+ | Prop | Type | Description |
1232
+ | -------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
1233
+ | **`product`** | <code><a href="#purchasesstoreproduct">PurchasesStoreProduct</a></code> | The product you want to purchase |
1234
+ | **`discount`** | <code><a href="#purchasespromotionaloffer">PurchasesPromotionalOffer</a></code> | Discount to apply to this package. Retrieve this discount using getPromotionalOffer. |
1235
+
1236
+
1237
+ #### PurchasesPromotionalOffer
1238
+
1239
+ | Prop | Type |
1240
+ | ------------------- | ------------------- |
1241
+ | **`identifier`** | <code>string</code> |
1242
+ | **`keyIdentifier`** | <code>string</code> |
1243
+ | **`nonce`** | <code>string</code> |
1244
+ | **`signature`** | <code>string</code> |
1245
+ | **`timestamp`** | <code>number</code> |
1246
+
1247
+
1248
+ #### PurchasePackageOptions
1249
+
1250
+ | Prop | Type | Description |
1251
+ | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1252
+ | **`aPackage`** | <code><a href="#purchasespackage">PurchasesPackage</a></code> | The Package you wish to purchase. You can get the Packages by calling getOfferings |
1253
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1254
+ | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1255
+
1256
+
1257
+ #### PurchaseSubscriptionOptionOptions
1258
+
1259
+ | Prop | Type | Description |
1260
+ | ------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1261
+ | **`subscriptionOption`** | <code><a href="#subscriptionoption">SubscriptionOption</a></code> | The <a href="#subscriptionoption">SubscriptionOption</a> you wish to purchase. You can get the <a href="#subscriptionoption">SubscriptionOption</a> from StoreProducts by calling getOfferings |
1262
+ | **`googleProductChangeInfo`** | <code><a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> \| null</code> | Android only. Optional <a href="#googleproductchangeinfo">GoogleProductChangeInfo</a> you wish to upgrade from containing the oldProductIdentifier and the optional prorationMode. |
1263
+ | **`googleIsPersonalizedPrice`** | <code>boolean \| null</code> | Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU. For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true. See https://developer.android.com/google/play/billing/integrate#personalized-price for more info. |
1264
+
1265
+
1266
+ #### PurchaseDiscountedPackageOptions
1267
+
1268
+ | Prop | Type | Description |
1269
+ | -------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
1270
+ | **`aPackage`** | <code><a href="#purchasespackage">PurchasesPackage</a></code> | The Package you wish to purchase. You can get the Packages by calling getOfferings |
1271
+ | **`discount`** | <code><a href="#purchasespromotionaloffer">PurchasesPromotionalOffer</a></code> | Discount to apply to this package. Retrieve this discount using getPromotionalOffer. |
1272
+
1273
+
1274
+ #### LogInResult
1275
+
1276
+ Holds the logIn result
1277
+
1278
+ | Prop | Type | Description |
1279
+ | ------------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------- |
1280
+ | **`customerInfo`** | <code><a href="#customerinfo">CustomerInfo</a></code> | The Customer Info for the user. |
1281
+ | **`created`** | <code>boolean</code> | True if the call resulted in a new user getting created in the RevenueCat backend. |
1282
+
1283
+
1284
+ #### SyncObserverModeAmazonPurchaseOptions
1285
+
1286
+ | Prop | Type | Description |
1287
+ | --------------------- | --------------------------- | ------------------------------------------------------------------------------- |
1288
+ | **`productID`** | <code>string</code> | Product ID associated to the purchase. |
1289
+ | **`receiptID`** | <code>string</code> | ReceiptId that represents the Amazon purchase. |
1290
+ | **`amazonUserID`** | <code>string</code> | Amazon's userID. This parameter will be ignored when syncing a Google purchase. |
1291
+ | **`isoCurrencyCode`** | <code>string \| null</code> | Product's currency code in ISO 4217 format. |
1292
+ | **`price`** | <code>number \| null</code> | Product's price. |
1293
+
1294
+
1295
+ #### IntroEligibility
1296
+
1297
+ Holds the introductory price status
1298
+
1299
+ | Prop | Type | Description |
1300
+ | ----------------- | ----------------------------------------------------------------------------- | ----------------------------------------- |
1301
+ | **`status`** | <code><a href="#intro_eligibility_status">INTRO_ELIGIBILITY_STATUS</a></code> | The introductory price eligibility status |
1302
+ | **`description`** | <code>string</code> | Description of the status |
1303
+
1304
+
1305
+ #### GetPromotionalOfferOptions
1306
+
1307
+ | Prop | Type | Description |
1308
+ | -------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
1309
+ | **`product`** | <code><a href="#purchasesstoreproduct">PurchasesStoreProduct</a></code> | The <a href="#purchasesstoreproduct">`PurchasesStoreProduct`</a> the user intends to purchase. |
1310
+ | **`discount`** | <code><a href="#purchasesstoreproductdiscount">PurchasesStoreProductDiscount</a></code> | The <a href="#purchasesstoreproductdiscount">`PurchasesStoreProductDiscount`</a> to apply to the product. |
1311
+
1312
+
1313
+ ### Type Aliases
1314
+
1315
+
1316
+ #### CustomerInfoUpdateListener
1317
+
1318
+ Listener used on updated customer info
1319
+
1320
+ <code>(customerInfo: <a href="#customerinfo">CustomerInfo</a>): void</code>
1321
+
1322
+
1323
+ #### PurchasesCallbackId
1324
+
1325
+ <code>string</code>
1326
+
1327
+
1328
+ #### MakePurchaseResult
1329
+
1330
+ <code>{ productIdentifier: string; customerInfo: <a href="#customerinfo">CustomerInfo</a>; }</code>
1331
+
1332
+
1333
+ #### LogHandler
1334
+
1335
+ <code>(logLevel: <a href="#log_level">LOG_LEVEL</a>, message: string): void</code>
1336
+
1337
+
1338
+ ### Enums
1339
+
1340
+
1341
+ #### PACKAGE_TYPE
1342
+
1343
+ | Members | Value | Description |
1344
+ | ----------------- | -------------------------- | ---------------------------------------------------------------- |
1345
+ | **`UNKNOWN`** | <code>"UNKNOWN"</code> | A package that was defined with a custom identifier. |
1346
+ | **`CUSTOM`** | <code>"CUSTOM"</code> | A package that was defined with a custom identifier. |
1347
+ | **`LIFETIME`** | <code>"LIFETIME"</code> | A package configured with the predefined lifetime identifier. |
1348
+ | **`ANNUAL`** | <code>"ANNUAL"</code> | A package configured with the predefined annual identifier. |
1349
+ | **`SIX_MONTH`** | <code>"SIX_MONTH"</code> | A package configured with the predefined six month identifier. |
1350
+ | **`THREE_MONTH`** | <code>"THREE_MONTH"</code> | A package configured with the predefined three month identifier. |
1351
+ | **`TWO_MONTH`** | <code>"TWO_MONTH"</code> | A package configured with the predefined two month identifier. |
1352
+ | **`MONTHLY`** | <code>"MONTHLY"</code> | A package configured with the predefined monthly identifier. |
1353
+ | **`WEEKLY`** | <code>"WEEKLY"</code> | A package configured with the predefined weekly identifier. |
1354
+
1355
+
1356
+ #### PRODUCT_CATEGORY
1357
+
1358
+ | Members | Value | Description |
1359
+ | ---------------------- | ------------------------------- | --------------------------------------- |
1360
+ | **`NON_SUBSCRIPTION`** | <code>"NON_SUBSCRIPTION"</code> | A type of product for non-subscription. |
1361
+ | **`SUBSCRIPTION`** | <code>"SUBSCRIPTION"</code> | A type of product for subscriptions. |
1362
+ | **`UNKNOWN`** | <code>"UNKNOWN"</code> | A type of product for unknowns. |
1363
+
1364
+
1365
+ #### PERIOD_UNIT
1366
+
1367
+ | Members | Value |
1368
+ | ------------- | ---------------------- |
1369
+ | **`DAY`** | <code>"DAY"</code> |
1370
+ | **`WEEK`** | <code>"WEEK"</code> |
1371
+ | **`MONTH`** | <code>"MONTH"</code> |
1372
+ | **`YEAR`** | <code>"YEAR"</code> |
1373
+ | **`UNKNOWN`** | <code>"UNKNOWN"</code> |
1374
+
1375
+
1376
+ #### RECURRENCE_MODE
1377
+
1378
+ | Members | Value | Description |
1379
+ | ------------------------ | -------------- | ----------------------------------------------------------- |
1380
+ | **`INFINITE_RECURRING`** | <code>1</code> | Pricing phase repeats infinitely until cancellation |
1381
+ | **`FINITE_RECURRING`** | <code>2</code> | Pricing phase repeats for a fixed number of billing periods |
1382
+ | **`NON_RECURRING`** | <code>3</code> | Pricing phase does not repeat |
1383
+
1384
+
1385
+ #### OFFER_PAYMENT_MODE
1386
+
1387
+ | Members | Value | Description |
1388
+ | ---------------------------------- | ------------------------------------------- | --------------------------------------------------------------------- |
1389
+ | **`FREE_TRIAL`** | <code>"FREE_TRIAL"</code> | Subscribers don't pay until the specified period ends |
1390
+ | **`SINGLE_PAYMENT`** | <code>"SINGLE_PAYMENT"</code> | Subscribers pay up front for a specified period |
1391
+ | **`DISCOUNTED_RECURRING_PAYMENT`** | <code>"DISCOUNTED_RECURRING_PAYMENT"</code> | Subscribers pay a discounted amount for a specified number of periods |
1392
+
1393
+
1394
+ #### PRORATION_MODE
1395
+
1396
+ | Members | Value | Description |
1397
+ | --------------------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1398
+ | **`UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY`** | <code>0</code> | |
1399
+ | **`IMMEDIATE_WITH_TIME_PRORATION`** | <code>1</code> | Replacement takes effect immediately, and the remaining time will be prorated and credited to the user. This is the current default behavior. |
1400
+ | **`IMMEDIATE_AND_CHARGE_PRORATED_PRICE`** | <code>2</code> | Replacement takes effect immediately, and the billing cycle remains the same. The price for the remaining period will be charged. This option is only available for subscription upgrade. |
1401
+ | **`IMMEDIATE_WITHOUT_PRORATION`** | <code>3</code> | Replacement takes effect immediately, and the new price will be charged on next recurrence time. The billing cycle stays the same. |
1402
+ | **`DEFERRED`** | <code>4</code> | Replacement takes effect when the old plan expires, and the new price will be charged at the same time. |
1403
+ | **`IMMEDIATE_AND_CHARGE_FULL_PRICE`** | <code>5</code> | Replacement takes effect immediately, and the user is charged full price of new plan and is given a full billing cycle of subscription, plus remaining prorated time from the old plan. |
1404
+
1405
+
1406
+ #### LOG_LEVEL
1407
+
1408
+ | Members | Value |
1409
+ | ------------- | ---------------------- |
1410
+ | **`VERBOSE`** | <code>"VERBOSE"</code> |
1411
+ | **`DEBUG`** | <code>"DEBUG"</code> |
1412
+ | **`INFO`** | <code>"INFO"</code> |
1413
+ | **`WARN`** | <code>"WARN"</code> |
1414
+ | **`ERROR`** | <code>"ERROR"</code> |
1415
+
1416
+
1417
+ #### INTRO_ELIGIBILITY_STATUS
1418
+
1419
+ | Members | Value | Description |
1420
+ | ---------------------------------------------------- | -------------- | ---------------------------------------------------------------------------- |
1421
+ | **`INTRO_ELIGIBILITY_STATUS_UNKNOWN`** | <code>0</code> | RevenueCat doesn't have enough information to determine eligibility. |
1422
+ | **`INTRO_ELIGIBILITY_STATUS_INELIGIBLE`** | <code>1</code> | The user is not eligible for a free trial or intro pricing for this product. |
1423
+ | **`INTRO_ELIGIBILITY_STATUS_ELIGIBLE`** | <code>2</code> | The user is eligible for a free trial or intro pricing for this product. |
1424
+ | **`INTRO_ELIGIBILITY_STATUS_NO_INTRO_OFFER_EXISTS`** | <code>3</code> | There is no free trial or intro pricing for this product. |
1425
+
1426
+
1427
+ #### BILLING_FEATURE
1428
+
1429
+ | Members | Value | Description |
1430
+ | ------------------------------- | -------------- | ---------------------------------------- |
1431
+ | **`SUBSCRIPTIONS`** | <code>0</code> | Purchase/query for subscriptions. |
1432
+ | **`SUBSCRIPTIONS_UPDATE`** | <code>1</code> | Subscriptions update/replace. |
1433
+ | **`IN_APP_ITEMS_ON_VR`** | <code>2</code> | Purchase/query for in-app items on VR. |
1434
+ | **`SUBSCRIPTIONS_ON_VR`** | <code>3</code> | Purchase/query for subscriptions on VR. |
1435
+ | **`PRICE_CHANGE_CONFIRMATION`** | <code>4</code> | Launch a price change confirmation flow. |
1436
+
1437
+
1438
+ #### REFUND_REQUEST_STATUS
1439
+
1440
+ | Members | Value | Description |
1441
+ | -------------------- | -------------- | ------------------------------------------------------------------ |
1442
+ | **`SUCCESS`** | <code>0</code> | Apple has received the refund request. |
1443
+ | **`USER_CANCELLED`** | <code>1</code> | User canceled submission of the refund request. |
1444
+ | **`ERROR`** | <code>2</code> | There was an error with the request. See message for more details. |
1445
+
1446
+ </docgen-api>