Spree Commerce
Open-source headless ecommerce platform with a REST API and Next.js storefront
Alternative to: Shopify, Magento, WooCommerce, Salesforce Commerce Cloud
spree/sdk@1.1.0
2026-06-11What’s Changed
-
Add provider-dispatched login.
client.auth.login()now accepts third-party identity-provider payloads (e.g.{ provider: 'auth0', token: '<jwt>' }) in addition to the existing{ email, password }shape —LoginCredentialsis now a discriminated union ofEmailPasswordLogin | ProviderLogin, both newly exported. Pairs with the server-side strategy registry atSpree.store_authentication_strategies. Existing email/password calls are unchanged. -
Add
client.newsletterSubscribers.create()andclient.newsletterSubscribers.verify()for the new Store API newsletter subscription endpoints.Lets headless storefronts subscribe guests to the newsletter before account creation and confirm the double opt-in via the verification token from the confirmation email. Pass
redirect_urloncreate()and the storefront receives anewsletter_subscriber.subscription_requestedwebhook with the token + validated redirect URL so it can send the confirmation email itself — same pattern ascustomer.password_reset_requested. When called with a JWT and the customer’s own email, the subscription is auto-verified.Consent is now preserved across registration: when
client.customers.create()is called with an email that already has a newsletter subscription on the current store, that subscriber is linked to the new user. If the subscription was verified,accepts_email_marketingis set totrueon the returned customer even when the registration body sentfalse— so guests who opted in before signing up don’t lose their consent. -
Custom field
field_typetoken.CustomFieldnow exposesfield_typeas a string-literal union ('short_text' | 'long_text' | 'rich_text' | 'number' | 'boolean' | 'json' | (string & {})) — abstract token instead of the Ruby STI class name. Aligns with how Shopify, Saleor, Vendure, and commercetools expose typed custom fields.- The legacy
typefield (e.g.'Spree::Metafields::ShortText') is unchanged and still emitted alongside the newfield_typefor back-compat. The TypeScript type is annotated with@deprecatedso editors surface the migration tip on hover; eslint withno-deprecatedwill flag references. Storefronts should switch tofield_type;typewill be removed in a future minor.
-
Sync Zod schemas with TypeScript types for
CustomerandPaymentMethod.CustomerSchemanow includesfull_name: string(already present in theCustomertype since the Admin Customers API landed; the runtime schema was stale).PaymentMethodSchemanow includessource_required: boolean(already present in thePaymentMethodtype).
No source-API change — this only affects callers using
CustomerSchema/PaymentMethodSchemafor runtime validation (e.g.,CustomerSchema.parse(response)). Validation no longer rejects these fields and parsed values are correctly typed. -
Expose
Product.meta_titlein the Store API.meta_titleis a storefront SEO field (used in<title>tags) — previously it was only on the Admin product serializer. Now serialized on the StoreProducttype asmeta_title: string | nullso storefronts can render it without a second admin call. -
Expose
Product.option_valuesin the Store API.The
Producttype now includes an optionaloption_values: Array<OptionValue>field, listing the option values that are actually in use across the product’s variants. This lets storefronts render option pickers (size, color, etc.) without iterating over every variant to collect them. -
Add sales-channel selection to the Store SDK via the
X-Spree-Channelheader.createClient({ channel: 'pos' })— set a client-level defaultclient.setChannel('wholesale')— sticky setter, mirrorssetLocale/setCurrency/setCountryawait client.products.list({}, { channel: 'pos' })— per-request override
The value can be either a channel
code(e.g.online,pos,wholesale) or the prefixed ID (ch_…);codeis preferred. Backend resolution stays atSpree::Api::V3::ChannelResolution: a matching header picks the channel for the request, otherwise the store’s default channel applies.