npm / @shopify/hydrogen
@shopify/hydrogen
What changed in @shopify/hydrogen 2024 to 2026, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-26.
41 breaking10 security11 deprecations61 new APIs and options1 performance24 behavior and defaults8 tooling42 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@shopify/hydrogen 2026171 changes
Breaking changes 40
The Shopify, .well-known, and UCP MCP proxies no longer forward client IP and forwarding headers supplied by the incoming request; the Storefront API proxy still sets Shopify-Storefront-Buyer-IP from requestContext.buyerIp.
Downloads the React Router template from the dist branch instead of dist-preview.
The Customer Account client fills an omitted variable only when the document declares it as LanguageCode; other types are left to the caller, while a passed value still takes precedence.
The resolved language, country, and pathPrefix are exposed as requestContext.locale and storefrontClient.locale, typed as ShopifyMatchedLocale.
Requests to the bare proxy prefix or its trailing-slash form now return 404 instead of proxying the Online Store home page; paths beneath the prefix remain proxied.
No longer follows redirects; a 3xx response throws StorefrontApiError, and rejected redirects do not contribute Set-Cookie headers.
Removes destroy because Hydrogen owns the shared analytics bus for the page lifetime; use the destination cleanup function when needed.
Removes the top-level event subscription method; register consumers through analytics.addDestination() and its setup callback instead.
Removed from private Storefront client configuration; provide it through a buyer-bearing request context instead.
Rejects JSON requests combining lines, discountCodes, attributes, or note with invalid_cart_request instead of silently dropping changes.
The standalone React export is removed; use the typed version from createCartComponents() instead.
custom-banner now requires an asynchronous setup callback that synchronizes third-party consent through Shopify's customerPrivacy API before resolving; events remain blocked if setup fails.
Private Storefront API buyer IP now comes exclusively from requestContext; buyerIp is removed from private client configuration.
Creates a local self-contained hydrogen-shop-pay-button instead of loading Shopify's hosted shop-js component; styling is limited to width and borderRadius.
Removes the unused type export; use AnalyticsEventMap and PayloadFor to type analytics event payloads.
Treats the variant search parameter as reserved and never returns it as a selected option.
Removes the Shop Pay button attributes helper.
Product URLs with numeric variant query parameters now redirect to canonical option-parameter URLs; unknown or deleted variants are stripped, and variants in combined listings can redirect to their own product page.
Returns null synchronously when no Shopify route matches; matched routes continue to return a Promise<Response>.
Stale-while-revalidate refreshes are no longer cancelled when the request or caller aborts and are bounded by defaultTimeoutInMs.
Removes the hosted shop-js loading API as part of rendering the Shop Pay button locally.
Changes from a bare amount string to the Storefront API MoneyV2 shape, so product_viewed events can obtain currency from currencyCode.
Hydrogen now uses Storefront API version 2026-10; deprecated discount fields have replacements, and lineLevelOnly defaults to true for cart-line discount allocations.
Removes locations, path, and extensions from the error and its toJSON output; GraphQL errors should be read from result.errors.
The standalone Vue export is removed; use the typed version from createCartComponents() instead.
When no return_to or redirect search parameter is present, saves the post-sign-in redirect as a normalized path on the storefront origin, falling back to defaultRedirectPath otherwise.
Developer tooling routes respond only to requests from the machine running the dev server; requests from other devices receive a 404, while storefront routes are unaffected.
The cookieDomain prop is a deprecated no-op because the Customer Privacy API manages Shopify cookies.
This option is deprecated and ignored as if it were true; setting it to false logs a warning.
Server-Timing headers are no longer collected or forwarded for tracking.
Hydrogen no longer creates this deprecated JavaScript-visible cookie; the Customer Privacy API handles migration and expiration of legacy analytics cookies.
Hydrogen no longer creates this deprecated JavaScript-visible cookie; the Customer Privacy API handles migration and expiration of legacy consent cookies.
The session is only cleared when the refresh token is missing or the token endpoint returns invalid_grant; other errors can be retried on a subsequent request.
The resource timing sampling rate is reduced from 100 to 10, changing how often PerfKit samples resource timings.
The plugin is no longer needed in the skeleton template because Vite 8 supports
resolve.tsconfigPathsnatively.For API version 2026-04 or later, JSON metafield writes are limited to 128KB; apps using them before April 1, 2026 are grandfathered at 2MB.
Cart operations return this specific error code when a Cart Transform Function fails at runtime, instead of the generic INVALID code.
The createRequestHandler option was removed because the Storefront API proxy is now always enabled.
The request handler throws an error if the load context lacks a storefront instance, rather than logging a warning.
The mutation now requires the discountCodes argument; custom cart discount code logic must include this field.
Security 8
Checkout redirects now send private, no-store cache headers, preventing shared caches from storing buyer-specific checkout URLs.
Adds a framework-independent utility for Shopify CSP directives; directive arrays extend defaults, and the development build allows common local HTTP and WebSocket connections.
Exports hashes for Shopify's static inline bootstraps so applications can authorize them with CSP hashes without per-request hashing or a shared framework nonce.
Responses Hydrogen makes private now drop Oxygen-Cache-Control and other vendor cache-control headers, preventing Oxygen full-page cache from storing customer data.
Makes the personalization marker public so apps can mark responses containing customer data Hydrogen cannot see; applying response headers then makes them private and uncacheable.
No longer caches responses with private or no-store Cache-Control, even when the query specifies a cache strategy; such responses also make the final response private when response headers are applied.
Sets integrity and other security attributes before inserting the script element into the DOM, preventing the browser from beginning a fetch before those attributes are applied.
OAuth state values now use cryptographically secure randomness, helping recover customer account login when switching browser contexts or opening multiple login tabs.
Deprecations 11
Remains available as a deprecated alias for defineShopifyRouteTemplates and will be removed in the next major release.
Renames createShopifyRouteTemplates; the old name remains a deprecated alias and will be removed in the next major release.
Passing a fixed language, country, and pathPrefix as i18n remains supported but is deprecated; use a defineShopifyI18n definition for URL matching.
Deprecated in favor of ShopifyLocale for language and country, ShopifyMatchedLocale for resolved locales, and ShopifyI18n for the definition.
Deprecated in favor of requestContext.locale; it still holds the resolved locale.
Deprecated in favor of storefrontClient.locale; it still holds the resolved locale.
@shopify/hydrogen/viteexports a deprecatedhydrogen()that throws an error explaining the installed version, the~2026.4.0pin, and the migration guide.Hydrogen now uses API version 2026-10; typed address mutations must use countryCode, and several deprecated or removed fields and types are affected.
The domain option is a deprecated no-op because the Customer Privacy API manages Shopify cookies.
The hasUserConsent option is a deprecated no-op; standalone integrations that used false to clear cookies should remove it because cookie lifecycle is handled automatically.
The ignoreDeprecatedCookies option is a deprecated no-op because the Customer Privacy API manages Shopify cookies and expires deprecated ones.
New APIs and options 49
Adds a framework-independent CSP utility that applies response headers and exposes a header for forwarding to a separate renderer. Nonce policies prevent document caching; nonce: false supports cached HTML and prerendered shells.
Accepts a defineShopifyI18n definition and matches the locale from the request URL or forwarded x-storefront-url header; an explicit locale is validated against the definition.
Defines serializable module-scope internationalization configuration that resolves the request locale, with pathname or domain routing.
Returns the segment that identifies a locale in a URL or route parameter, for every locale regardless of routing type.
Rewrites an href into another locale, producing a path for pathname routing or an absolute URL for domain routing.
Matches a locale from a Request, URL, URL string, or pathname, and throws for a string that is neither a URL nor a pathname.
Exports a type for typing usePredictiveSearch state from the same custom fragments as server handlers.
Validates an explicitly chosen locale or path segment against the definition and throws UnsupportedLocaleError otherwise.
Exports the options type of getSearchResultUrl.
Accepts an optional third type parameter for the handler context, defaulting to ShopifyRouteHandlerContext.
Adds a global identifying the application that rendered the page, with name hydrogen and the Hydrogen release version.
Enables loading Shopify's customer account web component through getShopifyScriptTags() and the React or Vue ShopifyScripts components.
Proxies caller-authenticated UCP MCP requests to the configured Shopify store.
Builds product-selection search parameters, removes stale option and variant parameters, and can emit shareable variant links.
Exported from @shopify/hydrogen for custom framework bindings; React and Vue continue exporting the same type.
Adds an optional merchandiseId field so cart line updates can swap an existing line to another variant.
Pass cart handlers to createCustomerAccountServerHandlers to synchronize existing carts with customer authorization, refresh, and logout.
Adds pending cart cost state while cost-affecting optimistic mutations settle.
Adds cart state that indicates authoritative cart reconciliation is in progress.
Reconciles the current cart after out-of-band mutations, waits for optimistic mutations, updates custom fragment fields, and loads a cart if the store has none.
Exported from @shopify/hydrogen for custom framework bindings; React and Vue continue exporting the same type.
Configures a HydrogenLogger-compatible logging sink and level for the application.
Custom runners can call run({ background: true }) to use the backgroundSignal cache option for stale-while-revalidate refreshes.
Can be imported from the storefront API types entry point; ProductPayload.price currencyCode uses this union.
Pass to createCartServerHandlers to create new carts with the current customer's buyer identity when the session has a usable access token.
Adds custom-element registration for the local Shop Pay button.
Adds a helper for constructing the Shop Pay checkout URL.
Analytics destinations can read consent-API uniqueToken and visitToken values; reads return empty strings when tracking is unavailable or disallowed.
Adds an overload that composes additional fragments onto an already-declared document while preserving inferred types.
Removes Hydrogen's local HTTPS files and can remove the shared mkcert CA with --remove-ca.
Defines the logging contract for trace, debug, info, warn, error, and fatal messages.
Adds portable local HTTPS development support for Customer Account API flows, including certificate provisioning and Shopify CLI configuration when available.
Can be imported from the storefront API types entry point when typing analytics payloads.
Adds a type for default product attribute values.
Adds a type for product attribute value registration.
Adds registration of line-item attributes through form-based add-to-cart; client and server payload parsing extract attributes.* entries from FormData.
Provides an explicit helper for provisioning local HTTPS certificates, including in CI environments.
Adds a way to render Shop Pay button server HTML.
Adds standard cart, search, policy, and collection-listing templates for consistent matching, resolution, and redirects; predictive search honors the configured search route.
Exports the customer account web-component script URL.
ShopifyScripts emits the event on initial page loads and SPA navigations and synchronizes the page template with PerfKit.
Registered route redirects can set an explicit status restricted to 301, 302, 303, 307, or 308.
Adds an optional createStorefrontClient option that sends the trusted Shopify-Storefront-Id header on direct and proxied requests.
Adds React and Vue cart actions for reconciling the current cart after out-of-band mutations.
Adds a Vue composable to subscribe the cart store to analytics tracking on mount and unsubscribe on dispose.
Adds generic cart result typing so custom cart fragments can use their generated fragment types.
Set to true before the Customer Privacy API script loads, this flag tells the consent library to use server-set cookies instead of the legacy _tracking_consent JavaScript cookie.
Hydrogen automatically proxies requests to /api/mcp to Shopify's Storefront MCP server when proxyStandardRoutes is enabled, which is the default.
This option on createCustomerAccountClient and createHydrogenContext makes the development tunnel domain check log a warning instead of throwing when set to true, enabling custom HTTPS setups for Customer Account API OAuth.
Performance 1
Long runs of slashes no longer slow standard route matching and URL redirect lookups; trailing slashes are trimmed in linear time.
Behavior and default changes 17
The utility applies script attributes before inserting the script into the DOM.
handleShopifyRoutesrequiressessionManageronly when a registered handler's context includes it, so cart-only apps can omit it; custom handlers can opt out by annotating their context.The PerfKit script configuration rendered by
ShopifyScriptsis updated in production builds.The cart store now applies calls that update or remove several lines at once, projecting and marking each line pending, rolling back on failure, and settling from the response.
handleShopifyRoutes forwards UCP buy permalinks to the configured Shopify store using a 303 no-store redirect; in-app navigation becomes document navigation.
Serves Shopify's managed UCP business profile from headless storefront origins.
Proxies allowlisted Shopify well-known resources.
Fails when a query selects a deprecated field when --fail-on-warn is used.
Works without a package.json by prompting to scaffold the React Router template or install AI coding skills only.
Returns the standard pathname and both standard and custom route templates.
Vue collection, cart, and product form callbacks now receive a SubmitEvent, so e.submitter can be read without casting.
The WebMCP CDN script URL is updated to shopifycloud/storefront/webmcp/webmcp.js.
Hydrogen uses visitor tracking values returned in the consentManagement response and enables asynchronous consent initialization so the Customer Privacy API fetches and caches them before analytics starts.
New Hydrogen projects created with this command default to Vite 8.
Peer dependencies now use caret ranges (^7.12.0), allowing Hydrogen projects to use newer React Router minor versions without peer dependency conflicts.
The skeleton robots.txt defaults no longer include disallow rules specific to Shopify themes, reducing confusion when reviewing or customizing rules in scaffolded projects.
Updated to the 2026-01 API version as part of Shopify's quarterly API release schedule.
Tooling 8
A fresh install ends with a message directing the console user to ask their agent to use the hydrogen-setup skill; runs that only resync skills print no extra message.
Copies the new migrate-to-hydrogen-2026-10 packaged skill into your project to guide migration from a classic Hydrogen storefront to Hydrogen 2026-10.
Editor completions for the type discriminant now suggest all client types, and config completions narrow to the selected type.
Installs the local certificate authority and generates certificate files for local HTTPS development.
Checks whether project skills match the installed Hydrogen package and exits non-zero by default when they are missing or out of sync.
Synchronizes packaged agent skills with the installed Hydrogen version, updating unmodified skills and preserving local edits unless --force is passed.
Hydrogen supports Vite 7 and Vite 8 while remaining backwards-compatible with Vite 5+.
Mini Oxygen's dev server uses the Vite Environment API, improving compatibility with Vite's built-in HMR and module invalidation.
Fixes and other changes 37
Checkout redirects no longer intercept account login, authorize, refresh, or logout routes, allowing apps' own handlers to receive them.
Re-added destinations resume retained-event delivery where they left off, and pending replay delivers retained events in order without skipping or duplicating the current event.
A malformed cart cookie is treated as a missing cart instead of failing the request.
Malformed percent sequences in collection filter keys remain literal instead of failing the request.
Returns opaque responses, such as browser redirect: manual responses, unchanged instead of failing with a RangeError while serializing their status.
Registered handlers now match after the request's locale prefix is stripped, so localized handler paths reach the handler instead of falling through to the app.
Canonical decimal values from serialized URLs and number inputs now parse correctly in shops whose locale uses a dot as the group separator.
A collection-scoped product match without a collection handle now uses the product's standard path and matches templates.standard.
register("remove") now returns formNoValidate: true and the new RemoveButtonAttributes type, allowing cart lines to be removed even when quantity input is invalid.
Resolves for require-based resolvers, including Jest in default CommonJS mode, the same way as the root entry point.
Marks the Standard Events CDN import with webpackIgnore so webpack and Turbopack leave it to the browser, fixing webpack builds and missing page-view events in Next.js Turbopack apps.
The Storefront API client again sends User-Agent: Hydrogen <version> on the server; browsers continue to set their own User-Agent.
Prevents cart hydration mismatches when asynchronous initial cart data resolves before a
useCartconsumer hydrates.A cart change made while a cart load is in flight no longer hides other lines or leaves loading stuck; the store revalidates when the change settles, including after destruction and reconnection.
The Storefront client injects the request market only for variables declared as
CountryCodeorLanguageCode; same-named variables of other types retain the caller's value and declared requiredness in the variables type.Built-in cart queries now select Cart.updatedAt so cart analytics deduplication works without a custom CartFragment.
Cart line updates retain merchandiseId, enabling a line to be swapped to another variant.
Preserves the minus sign when formatting negative amounts.
Accepts any Storefront client, including public or tokenless clients, because URL redirect lookup does not require a token.
Finalizes returned responses with Hydrogen storefront headers, including powered-by, so framework integrations can return them directly.
Inbox runtime prop validation is aligned with its boolean API.
Next.js markets guidance now explains how proxy.ts forwards Hydrogen request context to Server Components.
The Vue ShopifyScripts routes prop is optional at runtime and is included in the exported ShopifyScriptsProps type.
The Vue ShopifyScripts component now declares and forwards core script options including shopifyAnalytics.
Deferred cart, shop, and consent state updates use startTransition to prevent React from abandoning server-rendered HTML while Suspense boundaries are dehydrating.
publish from useAnalytics() re-checks consent when called, so events published after consent is revoked no longer reach subscribers.
Media URLs with query strings, such as Shopify CDN URLs ending in ?v=..., no longer incorrectly fall back to image/jpeg.
Consent and analytics require the same-origin Storefront API proxy included by Hydrogen's createRequestHandler; without it, consent cannot load, analytics stay off, and the privacy banner does not show.
The callback now waits for consent as well as selected APIs; failed initial consent keeps analytics and PerfKit blocked until a successful consent update.
Uses the provided cartId before falling back to getCartId().
Fluid images use width descriptors even when source-dimension filtering leaves exactly three srcset entries, so the sizes attribute is respected.
Hydrogen packages accept compatible React Router 7.16 patch versions, and new Hydrogen projects default to React Router 7.16.0.
Works for client-side navigations using either the .data pathname suffix or the _data query parameter, returning 204 for soft navigation redirect responses.
Cart GraphQL operations include the visitorConsent parameter only when explicitly provided, restoring compatibility with stores whose Storefront API schema lacks the VisitorConsent type.
The method is now typed as async (
Promise<void>), matching runtime behavior.In development, errors outside a
*.tryhydrogen.devtunnel URL now guide you to runshopify hydrogen dev --customer-account-pushand continue from the tunnel URL.Updated to the 2026-01 API version as part of Shopify's quarterly API release schedule.
@shopify/hydrogen 202524 changes
Security 2
Hydrogen peerDependencies now accept React ^18.3.1 or non-CVE-containing React 19 versions, allowing projects to upgrade to React 19 while React 18 remains compatible.
The Storefront API proxy in createRequestHandler obtains http-only cookies from Storefront API and can be disabled with this option.
New APIs and options 11
Adds gift card codes to a cart without replacing existing ones; duplicate codes are handled idempotently.
Adds a CartForm action for replacing all delivery addresses on a cart in a single operation.
Adds a CartForm action for adding gift card codes to a cart without replacing existing ones.
Supports the visitorConsent parameter to encode buyer consent preferences into the cart checkoutUrl via the _cs parameter.
Adds a cart handler method to replace all delivery addresses on a cart in a single operation.
Updated the Storefront API to version 2025-10, which adds new API behavior and mutations used by Hydrogen.
Adds an optional locale parameter to set the OAuth authorization URL's locale query parameter. Locale sources now use locale instead of ui_locales, with locale taking priority over uiLocales and configured language.
Adds an optional loginHintMode parameter. When set to 'submit' with loginHint, it passes login_hint_mode to the OAuth authorization URL and automatically submits the login form with the provided email.
Adds an optional parameter passed as the acr_values query parameter to the OAuth authorization URL, allowing requests for specific authentication methods or identity providers.
Adds an optional parameter passed as the login_hint query parameter to the OAuth authorization URL to pre-populate the login form with an email address.
createRequestHandler can now be used by every Hydrogen app, not only apps deployed to Oxygen, and is exported from @shopify/hydrogen.
Behavior and default changes 6
Updated the Customer Account API to version 2025-10.
Analytics.Provider now makes an internal request to the proxy to obtain cookies in the storefront domain.
Hydrogen supports Shopify’s new _shopify_analytics and _shopify_marketing http-only cookies while remaining backward compatible with _shopify_y and _shopify_s.
Hydrogen now uses React Router's stabilized v8_middleware future flag instead of its unstable counterpart.
Hydrogen now uses React Router's stabilized v8_splitRouteModules future flag instead of its unstable counterpart.
Hydrogen supports the _shopify_analytics and _shopify_marketing http-only cookies while remaining backward compatible with the deprecated _shopify_y and _shopify_s cookies.
Fixes and other changes 5
File paths containing spaces no longer cause errors with virtual routes because URL-encoded paths are decoded.
Passing an empty array now clears all delivery addresses from the cart; previously, it was effectively a no-op.
Fixed build failures caused by Node.js-specific imports in the virtual routes module.
Fixes issues causing irregular behavior between the Privacy Banner and Hydrogen analytics events.
useCustomerPrivacy now makes an internal request to the proxy to obtain cookies in the storefront domain.
@shopify/hydrogen 20243 changes
Breaking changes 1
useCustomerPrivacy now requests the proxy internally to obtain cookies in the storefront domain.
New APIs and options 1
This option disables the Storefront API proxy available in createRequestHandler.
Behavior and default changes 1
Hydrogen now supports this new Shopify http-only cookie while remaining backward compatible with the deprecated cookies.