@shoppexio/storefront 1.0.72 → 1.0.73

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.73
4
+
5
+ - `init({ currency })` is now enforced on every priced read (ADR-0066). `getStorefront`, `getStore`, `resolveStoreByDomain`, `getProducts`, `getStorefrontProductsPage` and `getProduct` send it as `?currency=`; before, only cart quotes and checkout used it, so a catalog could show one currency and the checkout price in another.
6
+ - A currency the shop has not enabled fails those reads with `code: 'errors.storefront.currency_unavailable'` (`errorParams.requested`, `errorParams.available`) instead of silently serving the shop default. New export `CURRENCY_UNAVAILABLE_ERROR_CODE`.
7
+ - `init` normalizes the currency to an upper-case ISO 4217 code and throws `ValidationError` for anything else.
8
+ - Response cache keys carry locale and buyer currency; a re-init with another audience no longer reads the previous audience's payloads.
9
+ - `Shop` gains `default_currency` and `available_currencies`; `Shop.currency` is documented as the currency the response is priced in.
10
+
3
11
  ## 1.0.72
4
12
 
5
13
  - REMOVED: the checkout Turnstile verification lane. `mountCheckoutChallenge`, `CheckoutChallengeCallbacks`, `CheckoutChallengeFrame`, `ApiChallenge`, `SDKResponse.challenge`, `retryWithProof`, and the `autoResolveChallenge`/`turnstileToken` checkout options are gone; invoice creation is a single request again and rate-limit refusals are plain 429s. Bot protection moved to the platform edge. The `X-Idempotency-Key` machinery is unchanged.
package/README.md CHANGED
@@ -47,6 +47,17 @@ if (line) {
47
47
  }
48
48
  ```
49
49
 
50
+ ## Buyer currency
51
+
52
+ `shoppex.init('store-slug', { currency: 'EUR' })` prices every catalog read
53
+ (`getStorefront`, `getStore`, `getProducts`, `getProduct`) in that currency and
54
+ uses it for cart quotes and checkout. The currency must be enabled in the
55
+ shop's settings: a read for a currency the shop does not sell in fails with
56
+ `code: 'errors.storefront.currency_unavailable'` and `errorParams.available`
57
+ listing the enabled ones. Nothing falls back to the shop default silently.
58
+ `data.shop.currency` names the currency a response is priced in;
59
+ `default_currency` and `available_currencies` describe the shop's setup.
60
+
50
61
  ## Multi-currency checkout
51
62
 
52
63
  When buyers can select a storefront currency, quote the cart and create the