k-sync
Back to blog

Shopify headless commerce for WooCommerce developers (2026)

How Shopify's headless commerce (Hydrogen, Storefront API) compares to WooCommerce headless setups — when to go headless after migration, the technical architecture, and whether it's worth it.

·By k-sync
5 min read · 950 words

WooCommerce developers who've built custom React or Vue frontends powered by the WooCommerce REST API have a parallel option on Shopify: headless commerce using the Shopify Storefront API and Hydrogen framework. This guide covers the technical architecture for developers evaluating whether to go headless on Shopify after migration.

Headless WooCommerce — the existing pattern

WooCommerce headless setups typically use:

Shopify headless options

1. Shopify Hydrogen (Remix-based)

Hydrogen is Shopify's official headless React framework, built on Remix. Launched 2022, significantly updated in 2023 with the Remix rebuild.

Hydrogen is the recommended path for greenfield headless Shopify development.

2. Custom Next.js + Shopify Storefront API

The most common pattern for developers already on Next.js:

3. Third-party headless platforms

Shopify Storefront API

The Storefront API is the read-only (+ cart mutations) GraphQL API that powers headless storefronts. Unlike the Admin API, it's designed for frontend use — public-facing, accessible from browsers.

// Storefront API access token (public, read-only scope)
const client = createStorefrontApiClient({
  storeDomain: 'your-store.myshopify.com',
  apiVersion: '2024-01',
  publicAccessToken: 'storefront_xxx',
});

// Query products
const { data } = await client.request(`
  query {
    products(first: 10) {
      nodes {
        id title handle
        priceRange { minVariantPrice { amount currencyCode } }
        images(first: 1) { nodes { url altText } }
        variants(first: 100) {
          nodes {
            id title availableForSale
            price { amount }
            selectedOptions { name value }
          }
        }
      }
    }
  }
`);

Cart management in Storefront API

// Create cart
mutation cartCreate($input: CartInput!) {
  cartCreate(input: $input) {
    cart { id checkoutUrl lines { nodes { id quantity } } }
  }
}

// Add to cart
mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {
  cartLinesAdd(cartId: $cartId, lines: $lines) {
    cart { id totalQuantity cost { totalAmount { amount } } }
  }
}

The cart.checkoutUrl redirects to Shopify's hosted checkout — headless storefronts typically use Shopify's checkout (not a custom checkout) to handle PCI compliance. Shopify Plus can customize the checkout extensively.

WPGraphQL + WooCommerce vs Shopify Storefront API

AspectWPGraphQL + WooCommerceShopify Storefront API
SchemaAutomatic from WooCommerce data modelFixed Shopify schema (but comprehensive)
Custom fieldsACF fields auto-exposed via WPGraphQL ACF pluginMetafields exposed via Storefront API (with allowlist)
CartWooCommerce session-based (CoCart for headless)Cart API — stateless, ID-based, no session
CheckoutCustom checkout page in frontend (complex)Hosted Shopify checkout via checkoutUrl
Real-time inventoryREST polling or custom subscriptionsavailableForSale field, quantityAvailable per variant
Auth/customersWordPress JWT tokensCustomer access tokens via Storefront API
Rate limitsServer-dependent1000 cost units/second (GraphQL cost-based)
Hosting backendWordPress serverShopify (no server to manage)

Should you go headless after migrating to Shopify?

Headless commerce adds significant development complexity. Consider it only if:

For most WooCommerce migrations, a well-configured Shopify theme performs excellently and requires far less development overhead. Shopify's official themes (Dawn, Sense) are highly optimized and customizable with Liquid + theme sections.

If you were on headless WooCommerce for performance reasons, an optimized Shopify theme often performs comparably or better — Shopify's CDN and image optimization can match custom headless performance for typical ecommerce pages.

Migrating a headless WooCommerce frontend to Shopify

If you have an existing headless WooCommerce frontend (Next.js + WPGraphQL) and want to keep the same frontend architecture:

  1. Replace data layer: Swap WPGraphQL queries for Shopify Storefront API queries. Field mapping per the WooCommerce → Shopify data mapping.
  2. Cart rewrite: WooCommerce session-based cart (CoCart) → Shopify Cart API. Stateless approach is simpler.
  3. Checkout redirect: Replace WooCommerce checkout page with redirect to cart.checkoutUrl.
  4. Auth: Replace WP JWT auth with Shopify Storefront API customer access tokens.
  5. Metafields: Product metafields need to be allowlisted in Shopify Admin → Settings → Custom data → Storefront access to be readable by the Storefront API.

Hydrogen quickstart for WooCommerce developers

npx degit Shopify/hydrogen/templates/skeleton my-hydrogen-store
cd my-hydrogen-store
npm install
cp .env.example .env

# Add to .env:
# SESSION_SECRET=xxx
# PUBLIC_STOREFRONT_API_TOKEN=storefront_xxx
# PUBLIC_STORE_DOMAIN=your-store.myshopify.com

npm run dev

The Hydrogen skeleton template includes a complete product listing, product detail page, cart, and checkout redirect. Compare this to the significant boilerplate required for a WooCommerce headless setup — Hydrogen covers cart and checkout out of the box without CoCart or similar workarounds.

For most WooCommerce developers evaluating Shopify: start with a regular Shopify theme. Go headless only if you have specific requirements that themes genuinely can't meet — not for performance, not for "control", but for truly custom frontend requirements.

Migrate your store with k-sync

Connect your WooCommerce store, validate your products, and push to Shopify in minutes. Free for up to 50 products.

Get started free

Related reading

Browse all migration guides