2.2.0 (2026-08-06)
Tracks @spwig/sdk 2.2.0 and the Spwig 1.7.1 release. Requires
@spwig/sdk ^2.2.0.
@spwig/sdk 2.2.0
(sale-pricing, region availability, subscription tokens). It ships as a minor
deliberately. There are no breaking changes in the React layer itself: every hook re-uses the SDK's payload types, so the breaks surface as SDK type changes, not renamed or
removed hooks. See the @spwig/sdk 2.2.0 changelog for the field-level detail
and migration steps.
Added
useSetRegion()— mutation wrappingstore.setRegion(country). Sets the
shopper's ship-to region and invalidates catalog (productships_to_region/
regional stock), cart (regional pricing), and currency.useBeginSubscriptionTokenSetup()— mutation wrapping
subscriptions.beginTokenSetup(). Begins provider-agnostic setup for a
reusable subscription payment method; the returned bundle mints a token you
then bind withuseAttachSubscriptionToken().useAttachSubscriptionToken()— mutation wrapping
cart.attachSubscriptionToken(). Binds a PaymentToken to a subscription cart
line and invalidates the cart. Requires an authenticated shopper.
Changed
- Inherited breaking type changes from
@spwig/sdk2.2.0 (no hook renamed or
removed):Product.compare_at_price_amountis now null-off-sale (use the new
effective_price_amount+is_on_sale);Product.is_in_stockincludes
pre-order/backorder;CreatePaymentIntentInput.checkout_session_idis a
number; theadminattribute-assign payload, branding update, and bulk
price/sale bounds changed. Consumers ofuseCatalog/useProduct,
useCreatePaymentIntent, and the affected admin hooks should re-typecheck and
follow the SDK migration notes. CartItemnow carries sale + subscription fields (is_on_sale,
regular_total,pricing_tier_details,subscription_billing_display,
subscription_unit_price); theuseAddToCartoptimistic placeholder was
updated to populate them.