@revenuecat/purchases-js 0.13.0 → 0.14.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
@@ -54,6 +54,36 @@ In your testing project install the library as.
54
54
  npm i /path/to/purchases-js
55
55
  ```
56
56
 
57
+ ## Running Storybook
58
+
59
+ ```bash
60
+ npm run storybook
61
+ ```
62
+
63
+ ### Environment Setup for Needs Payment Info Stories
64
+
65
+ > **Note:** This setup is only required if you need to test Storybook stories involving the `state-needs-payment-info` component.
66
+
67
+ To run these specific stories, you'll need to set up some environment variables. There are two options:
68
+
69
+ ### Option 1: Internal Teams
70
+
71
+ Internal team members can find the required environment variables in 1Password.
72
+
73
+ ### Option 2: Setup Manually
74
+
75
+ 1. Create a test account in Stripe
76
+ 2. Go to settings, API keys, and create a restricted key with the following permissions:
77
+ - Setup intent (read/write)
78
+ - Payment methods (read/write)
79
+ 3. Create a `.env.development.local` file and set the following variables:
80
+
81
+ ```bash
82
+ VITE_STORYBOOK_RESTRICTED_SECRET="sk_test_1234567890"
83
+ VITE_STORYBOOK_PUBLISHABLE_API_KEY="pk_test_1234567890"
84
+ VITE_STORYBOOK_ACCOUNT_ID="acct_1234567890"
85
+ ```
86
+
57
87
  ## Running tests
58
88
 
59
89
  ```bash
@@ -637,6 +637,15 @@ export declare interface PurchaseParams {
637
637
  * The email of the user. If undefined, RevenueCat will ask the customer for their email.
638
638
  */
639
639
  customerEmail?: string;
640
+ /**
641
+ * The locale to use for the purchase flow. If not specified, English will be used
642
+ */
643
+ selectedLocale?: string;
644
+ /**
645
+ * The default locale to use if the selectedLocale is not available.
646
+ * Defaults to english.
647
+ */
648
+ defaultLocale?: string;
640
649
  }
641
650
 
642
651
  /**
@@ -769,7 +778,7 @@ export declare class Purchases {
769
778
  /**
770
779
  * Generates an anonymous app user ID that follows RevenueCat's format.
771
780
  * This can be used when you don't have a user identifier system in place.
772
- * The generated ID will be in the format: $RCAnonymousID:<UUID without dashes>
781
+ * The generated ID will be in the format: $RCAnonymousID:\<UUID without dashes\>
773
782
  * Example: $RCAnonymousID:123e4567e89b12d3a456426614174000
774
783
  * @returns A new anonymous app user ID string
775
784
  * @public