@moonbase.sh/storefront-api 3.9.0 → 3.10.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
@@ -110,10 +110,10 @@ another tenant's) arrives as the same `NotFoundError`, so that a signed-in
110
110
  customer cannot use it to enumerate a merchant's group IDs. Joining twice
111
111
  succeeds and changes nothing.
112
112
 
113
- ### Captchas on sign-up
113
+ ### Captchas on sign-up and newsletter sign-ups
114
114
 
115
- A merchant can ask customers to solve a captcha before they sign up. The vendor
116
- says whether this store does:
115
+ A merchant can ask customers to solve a captcha before they sign up or subscribe
116
+ to the newsletter. The vendor says whether this store does:
117
117
 
118
118
  ```ts
119
119
  const vendor = await client.vendor.get()
@@ -172,6 +172,13 @@ refused with `CaptchaRequiredError` (a `MoonbaseError`). A site with a
172
172
  Content-Security-Policy has to allow the store's `https://<account-id>.moonbase.sh`
173
173
  in `frame-src`.
174
174
 
175
+ A newsletter sign-up works the same way, with a frame drawn for
176
+ `action=subscribe` (a solution is only good for the action it was drawn for):
177
+
178
+ ```ts
179
+ await client.communications.subscribe({ email: 'jane@example.com', captchaToken })
180
+ ```
181
+
175
182
  ### Where a customer came from
176
183
 
177
184
  Pass the UTM tags, ad click IDs and referrer the visitor arrived with, the same