/weaverse:shopify-hydrogenfrom weaverse
Provides core Shopify Hydrogen 2026.10 APIs including server request lifecycle, Storefront client with gql(), cart handlers, ShopifyScripts, and CSP configuration. Useful when building Hydrogen storefronts.
Ships in weaverse. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Hydrogen 2026.10 is a library of server handlers and client stores, not a framework. Your app owns the request lifecycle in server.ts and calls into Hydrogen where it needs Shopify. React Router 7 renders the app.
Imports come from @shopify/hydrogen (server handlers, gql, Cache, types), @shopify/hydrogen/react (client stores and components such as createCartComponents, ShopifyScripts, ShopPayButton), @shopify/hydrogen/customer-account and @shopify/hydrogen/vite.
This skill describes Hydrogen 2026.10 as Pilot
mainimplements it. Classic Hydrogen (2026.4 and earlier:createHydrogenContext,storefront.query(),CartForm,Analytics.Provider) is covered by thehydrogen-upgradesskill, including the2026.4.7 → 2026.10.2migration guide.
@shopify/hydrogen 2026.10 also ships its own version-matched agent skills (hydrogen-request-handlers, hydrogen-cart-drawer, hydrogen-markets, migrate-to-hydrogen-2026-10, ...). Sync them into the project and use them alongside this skill:
npx @shopify/hydrogen skills sync # copies them to .agents/skills/ and .claude/skills/
Re-run the sync after every @shopify/hydrogen upgrade, and don't edit the copies. Prefix dev with hydrogen skills check --mode=warn so a stale copy prints the resync command. Every API in this skill is checked against 2026.10.3; if the installed version differs, trust node_modules/@shopify/hydrogen and its synced skills.
Run these from this skill's own folder; the paths below are relative to the skill root.
For the most up-to-date Hydrogen API docs, use the search script:
node scripts/search_shopify_docs.mjs "<query>"
This queries Shopify's developer docs (shopify.dev) directly and returns the latest API references, code examples, and guides for Hydrogen.
Examples:
node scripts/search_shopify_docs.mjs "handleShopifyRoutes"
node scripts/search_shopify_docs.mjs "createCartServerHandlers"
node scripts/search_shopify_docs.mjs "createStorefrontClient graphql cache"
node scripts/search_shopify_docs.mjs "createCustomerAccountServerHandlers"
node scripts/search_shopify_docs.mjs "ShopifyScripts analytics"
For offline/cached reference, see the references/ folder below.
server.ts)createHydrogenContext() and Hydrogen's createRequestHandler are gone. A module-format fetch handler composes:
createAppContext() — your own function building the session, the request-scoped storefront client, the customer account wrapper and any CMS client (Weaverse).handleShopifyRoutes({ request, requestContext, sessionManager, storefrontClient, routeTemplates, handlers }) — answers the paths Hydrogen owns (/api/cart, /api/predictive-search, the Storefront API proxy, /checkout, cart and /buy permalinks, the AJAX cart, /.well-known/ucp, /api/mcp, /api/ucp/mcp, ?variant= links, /account/login|authorize|refresh|logout). Returns a Promise<Response> or null; check it without await. Call it for every request; never whitelist its paths.createRequestHandler(serverBuild, mode) with the app context copied onto a RouterContextProvider.requestContext.applyResponseHeaders(response.headers).handleShopifyRedirects({ request, storefrontClient, routeTemplates }) for Shopify URL redirects.routeTemplates comes from defineShopifyRouteTemplates() (createShopifyRouteTemplates is its deprecated alias). Omitting it, or applyResponseHeaders, fails silently.
Shopify's React Router template runs the same phases in a root-route middleware export instead of server.ts. Pilot keeps server.ts; see 05-storefront-contracts.md for the mapping before you follow a Hydrogen doc or skill that shows the middleware shape.
createStorefrontClient({ type: "private" | "public", requestContext: createShopifyRequestContext({ request, i18n, buyerIp }), config }). Use the private token when Oxygen injects PRIVATE_STOREFRONT_API_TOKEN (with the buyer IP), the public one otherwise.
i18n is a module-scope defineShopifyI18n({ defaultLocale, routing: { type: "pathname", locales } }) definition. The request's market is storefront.locale ({ language, country, pathPrefix, ... }). storefront.i18n, a fixed { language, country, pathPrefix } passed as i18n, and I18nConfig are deprecated in 2026.10.3. Pass locale to createShopifyRequestContext only when the URL can't tell the market (Pilot does, for unprefixed Hydrogen endpoints).
import { gql, type StorefrontApi } from "@shopify/hydrogen";
export const PRODUCT_QUERY = gql(`query product(...) { ... }`, [MEDIA_FRAGMENT]);
export type ProductQuery = StorefrontApi.ResultOf<typeof PRODUCT_QUERY>;
const { product } = await storefront
.graphql(PRODUCT_QUERY, { variables: { handle }, cache: CACHE_DEFAULT })
.then(unwrapStorefront);
graphql() returns { data, errors, headers } and does not throw on GraphQL errors.gql()'s second argument, never ${} interpolation.$country / $language are filled from the request context; don't pass them.@shopify/hydrogen/ts-plugin (no codegen). hydrogen gql check --fail-on-warn validates every document, including deprecated fields.There is no default cache. Pass cache on every query: Cache({...}), Cache.short(), Cache.long(), Cache.none() from @shopify/hydrogen. CacheShort/CacheLong/CacheNone/CacheCustom and generateCacheControlHeader are gone.
createCartServerHandlers({ fragment }) serves /api/cart. createCartComponents<typeof cartHandlers>() from @shopify/hydrogen/react gives CartProvider, useCart, useCartForm, useCartActions. CartForm, context.cart, useOptimisticCart and the /cart action are gone.
createCustomerSession() + createCustomerAccountServerHandlers() from @shopify/hydrogen/customer-account own the fixed, unprefixed /account/login, /account/authorize, /account/refresh and /account/logout. Link to them with a plain <a>/<form>, not <Link>/<Form>. Local login needs HTTPS (localHttps() Vite plugin).
ShopifyScripts from @shopify/hydrogen/react (first in <head>, with shop, i18n, analytics, consent, routes={routeTemplates} and navigate) replaces Analytics.Provider. It also loads Standard Actions and WebMCP. Publish PAGE_VIEWED and route events to window.Shopify.analytics yourself; useCartAnalytics() publishes cart events from the cart store.
window.Shopify.actions exposes getCart, updateCart and openCart, the contract shared with theme apps and WebMCP agents. Hydrogen's cart store configures updateCart; the app must configure openCart to open its drawer (openCart.configure({ handler })). UCP discovery (/.well-known/ucp), MCP (/api/mcp, /api/ucp/mcp) and /buy links come from handleShopifyRoutes(). Details: 05-storefront-contracts.md.
createContentSecurityPolicy({ shop, nonce, directives }), getShopifyCspDirectives() and getShopifyScriptHashes() are back in 2026.10.3 as framework-neutral functions (no NonceProvider/useNonce). Pilot calls createContentSecurityPolicy({ nonce: false, ... }) with 'unsafe-inline' scripts in entry.server.tsx, so the document stays full-page cacheable, and sends the header report-only.
Removed from @shopify/hydrogen | Replacement |
|---|---|
Image, Money, ExternalVideo, ModelViewer | Local components (Pilot: app/components/) |
Pagination, getPaginationVariables | Local ports (Pilot: app/components/pagination.tsx, app/utils/pagination.ts) |
getSeoMeta, SeoConfig, sitemap helpers | Local ports (Pilot: app/utils/seo-meta.ts, app/.server/sitemap.ts) |
NonceProvider, useNonce, Script | None needed with nonce: false; in nonce mode, an app-owned React context for csp.nonce |
ShopPayButton | @shopify/hydrogen/react |
getSelectedProductOptions | @weaverse/hydrogen/react-router in Weaverse themes |
flattenConnection is still exported by @shopify/hydrogen. createContentSecurityPolicy was missing in 2026.10.0-2 and is back in 2026.10.3, with a new signature; delete any local app/utils/csp.ts port when you upgrade.
vite dev, react-router build, vite preview; Vite plugins localHttps() (@shopify/hydrogen/vite) and ...oxygen() (@shopify/mini-oxygen/vite), no hydrogen() plugin; no React Router preset; deploy with shopify hydrogen deploy --assets-dir dist/client --worker-dir dist/server.
For offline/cached reference when the search script is unavailable:
| File | Contents |
|---|---|
| references/01-setup.md | server.ts lifecycle, createAppContext, storefront client, session, env vars, build config |
| references/02-caching.md | Cache strategies, CACHE_* constants, Cache-Control headers, what to cache |
| references/03-cart.md | /api/cart handlers, cart fragment, createCartComponents, cart forms, app-owned cart handlers |
| references/04-ssr-performance.md | SSR bundle diet (worker inlines dynamic imports — resolveId stub pattern), bundle audit, TTFB measurement methodology |
| references/05-storefront-contracts.md | Syncing Hydrogen's packaged skills, the routes Hydrogen owns (UCP, MCP, /buy, AJAX cart), ShopifyScripts and Standard Actions (openCart), defineShopifyI18n, createContentSecurityPolicy modes, server.ts vs root middleware, production checklist |
references/01-setup.md (opens in a new tab)references/02-caching.md (opens in a new tab)references/03-cart.md (opens in a new tab)references/04-ssr-performance.md (opens in a new tab)references/05-storefront-contracts.md (opens in a new tab)scripts/check_docs_helpers.mjs (opens in a new tab)scripts/get_weaverse_page.mjs (opens in a new tab)scripts/search_shopify_docs.mjs (opens in a new tab)scripts/search_weaverse_docs.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub weaverse/shopify-hydrogen-skills --plugin weaverse14 skills in this plugin
/cloning-websites-to-weaverseUse when recreating a reference website or brand hub in this Hydrogen plus Weaverse repo, especially when deciding whether to reuse sections, add global styles, update theme schema, or resolve conflicts between the live site and project brand guidelines./figma-to-weaverseUse when recreating a Figma design as Hydrogen + Weaverse pages in this repo — turning a Figma file, frame, or flow into reusable Weaverse sections. Triggers on a figma.com URL, "build this design", "implement this Figma", or "create the storefront from the design". The Figma counterpart of cloning-websites-to-weaverse./generating-weaverse-project-jsonUse when generating Weaverse project export JSON for import into the Weaverse editor. Triggers on requests to create, build, or produce a Weaverse project JSON file from a site migration, design spec, page layout description, or existing export. Also use when converting section plans into importable project and pages data./hydrogen-analytics-trackingEnd-to-end analytics & conversion tracking on Shopify Hydrogen — GTM, GA4 (browser + Measurement Protocol), Meta Pixel + CAPI, Google Ads, consent mode, CSP, Oxygen full-page cache. Real-world patterns from production deployments./hydrogen-cookbooksStep-by-step implementation guides for building features in a Shopify Hydrogen 2026.10 + Weaverse storefront (Pilot) — bundles, combined listings, customer accounts, 3D models, performance, variant media, and Weaverse integration./hydrogen-markets-localizationImplement or review Shopify Hydrogen market localization — use when adding markets, locale routes, translations, hreflang, RTL, or localized cart, account, and checkout behavior in Hydrogen + Weaverse.Other plugins' skills for the same job