@revenuecat/purchases-js 0.3.4 → 0.4.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 CHANGED
@@ -51,7 +51,7 @@ To avoid publishing the package you can set it up as a local dependency.
51
51
  In your testing project install the library as.
52
52
 
53
53
  ```bash
54
- npm i /path/to/rcbilling-js
54
+ npm i /path/to/purchases-js
55
55
  ```
56
56
 
57
57
  ## Running tests
@@ -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
@@ -541,9 +558,10 @@ export declare class Purchases {
541
558
  * keep the returned instance around for use throughout your application.
542
559
  * @param apiKey - RevenueCat API Key. Can be obtained from the RevenueCat dashboard.
543
560
  * @param appUserId - Your unique id for identifying the user.
561
+ * @param httpConfig - Advanced http configuration to customise the SDK usage {@link HttpConfig}.
544
562
  * @throws {@link PurchasesError} if the API key or user id are invalid.
545
563
  */
546
- static configure(apiKey: string, appUserId: string): Purchases;
564
+ static configure(apiKey: string, appUserId: string, httpConfig?: HttpConfig): Purchases;
547
565
  /**
548
566
  * Fetch the configured offerings for this user. You can configure these
549
567
  * in the RevenueCat dashboard.