@revenuecat/purchases-js 0.3.4 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Purchases.es.d.ts +54 -1
- package/dist/Purchases.es.js +948 -886
- package/dist/Purchases.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/Purchases.es.d.ts
CHANGED
|
@@ -170,6 +170,23 @@ export declare enum ErrorCode {
|
|
|
170
170
|
InvalidEmailError = 38
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Parameters used to customise the http requests executed by purchases-js.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
export declare interface HttpConfig {
|
|
178
|
+
/**
|
|
179
|
+
* Additional headers to include in all HTTP requests.
|
|
180
|
+
*/
|
|
181
|
+
additionalHeaders?: Record<string, string>;
|
|
182
|
+
/**
|
|
183
|
+
* Set this property to your proxy URL *only* if you've received a proxy
|
|
184
|
+
* key value from your RevenueCat contact. This value should never end with
|
|
185
|
+
* a trailing slash.
|
|
186
|
+
*/
|
|
187
|
+
proxyURL?: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
173
190
|
/**
|
|
174
191
|
* Possible levels to log in the console.
|
|
175
192
|
* @public
|
|
@@ -377,6 +394,21 @@ export declare enum PeriodUnit {
|
|
|
377
394
|
Day = "day"
|
|
378
395
|
}
|
|
379
396
|
|
|
397
|
+
/**
|
|
398
|
+
* Contains data about the context in which an offering was presented.
|
|
399
|
+
* @public
|
|
400
|
+
*/
|
|
401
|
+
export declare interface PresentedOfferingContext {
|
|
402
|
+
/**
|
|
403
|
+
* The identifier of the offering used to obtain this object.
|
|
404
|
+
*/
|
|
405
|
+
readonly offeringIdentifier: string;
|
|
406
|
+
/**
|
|
407
|
+
* The targeting context used to obtain this object.
|
|
408
|
+
*/
|
|
409
|
+
readonly targetingContext: TargetingContext | null;
|
|
410
|
+
}
|
|
411
|
+
|
|
380
412
|
/**
|
|
381
413
|
* Price information for a product.
|
|
382
414
|
* @public
|
|
@@ -458,8 +490,13 @@ export declare interface Product {
|
|
|
458
490
|
readonly normalPeriodDuration: string | null;
|
|
459
491
|
/**
|
|
460
492
|
* The offering ID used to obtain this product.
|
|
493
|
+
* @deprecated - Use {@link Product.presentedOfferingContext} instead.
|
|
461
494
|
*/
|
|
462
495
|
readonly presentedOfferingIdentifier: string;
|
|
496
|
+
/**
|
|
497
|
+
* The context from which this product was obtained.
|
|
498
|
+
*/
|
|
499
|
+
readonly presentedOfferingContext: PresentedOfferingContext;
|
|
463
500
|
/**
|
|
464
501
|
* The default subscription option for this product. Null if no subscription
|
|
465
502
|
* options are available like in the case of consumables and non-consumables.
|
|
@@ -541,9 +578,10 @@ export declare class Purchases {
|
|
|
541
578
|
* keep the returned instance around for use throughout your application.
|
|
542
579
|
* @param apiKey - RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
|
|
543
580
|
* @param appUserId - Your unique id for identifying the user.
|
|
581
|
+
* @param httpConfig - Advanced http configuration to customise the SDK usage {@link HttpConfig}.
|
|
544
582
|
* @throws {@link PurchasesError} if the API key or user id are invalid.
|
|
545
583
|
*/
|
|
546
|
-
static configure(apiKey: string, appUserId: string): Purchases;
|
|
584
|
+
static configure(apiKey: string, appUserId: string, httpConfig?: HttpConfig): Purchases;
|
|
547
585
|
/**
|
|
548
586
|
* Fetch the configured offerings for this user. You can configure these
|
|
549
587
|
* in the RevenueCat dashboard.
|
|
@@ -668,6 +706,21 @@ export declare class Purchases {
|
|
|
668
706
|
readonly trial: PricingPhase | null;
|
|
669
707
|
}
|
|
670
708
|
|
|
709
|
+
/**
|
|
710
|
+
* Contains information about the targeting context used to obtain an object.
|
|
711
|
+
* @public
|
|
712
|
+
*/
|
|
713
|
+
export declare interface TargetingContext {
|
|
714
|
+
/**
|
|
715
|
+
* The rule id from the targeting used to obtain this object.
|
|
716
|
+
*/
|
|
717
|
+
readonly ruleId: string;
|
|
718
|
+
/**
|
|
719
|
+
* The revision of the targeting used to obtain this object.
|
|
720
|
+
*/
|
|
721
|
+
readonly revision: number;
|
|
722
|
+
}
|
|
723
|
+
|
|
671
724
|
/**
|
|
672
725
|
* Error indicating that the SDK was accessed before it was initialized.
|
|
673
726
|
* @public
|