Shopify's theme-based storefronts serve the majority of merchants well. But for brands that need complete design freedom, unique interactive experiences, or integration with content from multiple sources, the traditional Liquid-based approach becomes a constraint. Headless Shopify — using the Storefront API to power a custom frontend — removes those constraints entirely.
At StrikingWeb, we have built headless Shopify storefronts for brands that outgrew the limitations of themes. The results consistently show faster page loads, higher conversion rates, and dramatically more creative design possibilities. This guide covers the architecture, tools, and practical considerations for going headless.
What Does "Headless" Actually Mean?
In a headless architecture, the frontend (what customers see) is completely separated from the backend (Shopify's commerce engine). Shopify continues to handle products, inventory, orders, payments, and shipping. But instead of rendering pages through Liquid templates, the storefront is a standalone web application — typically built with React, Vue, or Next.js — that fetches data from Shopify through the Storefront API.
This separation provides several fundamental advantages:
- Complete design freedom: You are not constrained by Shopify's theme architecture. Any layout, interaction, or animation is possible
- Performance control: You choose the rendering strategy — static generation, server-side rendering, or client-side rendering — optimized for your specific use case
- Multi-source content: Combine Shopify product data with content from a CMS, blog platform, or any other API in a single unified frontend
- Technology flexibility: Use any frontend framework, build tool, or hosting platform rather than being locked into Shopify's ecosystem
The Storefront API
The Storefront API is a GraphQL API designed specifically for building custom storefronts. Unlike the Admin API (which manages store operations), the Storefront API is optimized for customer-facing queries — fetching products, managing carts, processing checkouts, and handling customer accounts.
Key API Capabilities
The Storefront API provides access to:
- Products and collections: Query products with filtering, sorting, and pagination. Access variants, images, metafields, and pricing
- Cart: Create and manage shopping carts with line items, discount codes, and shipping calculations
- Checkout: Create checkout sessions that redirect to Shopify's hosted checkout or use the Checkout API for custom checkout experiences on Shopify Plus
- Customer accounts: Handle registration, authentication, and order history
- Content: Access blogs, articles, and pages created in the Shopify admin
- Localization: Support multiple currencies, languages, and regional pricing
GraphQL Queries
A typical product query demonstrates the flexibility of GraphQL — you request exactly the data you need and receive nothing more:
query ProductByHandle($handle: String!) {
product(handle: $handle) {
title
description
priceRange {
minVariantPrice {
amount
currencyCode
}
}
images(first: 5) {
edges {
node {
url
altText
width
height
}
}
}
variants(first: 10) {
edges {
node {
id
title
availableForSale
price { amount currencyCode }
}
}
}
}
}
This single query retrieves everything needed to render a product page — title, pricing, images, and variant information — in one network request.
Shopify Hydrogen
Hydrogen is Shopify's official React-based framework for building headless storefronts. Built on Remix, it provides a complete starting point with routing, data fetching, caching, and Shopify-specific components and hooks.
Why Hydrogen?
While you can build a headless Shopify storefront with any framework, Hydrogen provides significant advantages:
- Shopify-optimized components: Pre-built components for product images, variant selectors, cart drawers, and checkout buttons that handle common e-commerce patterns
- Built-in caching: Intelligent caching strategies that balance freshness with performance. Product pages can be cached aggressively while cart data remains real-time
- Streaming SSR: Server-side rendering with streaming delivers the initial HTML quickly while still loading dynamic content
- SEO defaults: Automatic generation of sitemaps, robots.txt, and structured data for product pages
- Oxygen hosting: Shopify's hosting platform is purpose-built for Hydrogen, deployed to the edge for global performance
Hydrogen Project Structure
A Hydrogen project follows Remix conventions with Shopify-specific additions. Routes map to URL paths, loaders fetch data on the server, and components render the UI. The Shopify client is configured once and available throughout the application for making Storefront API queries.
Hydrogen is not just a starter template — it is a production-ready framework that handles the complex plumbing of headless commerce: cart state management, checkout flows, analytics integration, and internationalization. Building these from scratch takes months; Hydrogen provides them out of the box.
Alternative Frontend Approaches
Hydrogen is not the only option. Depending on your team's expertise and project requirements, other frameworks may be better suited.
Next.js with Shopify
Next.js is the most popular alternative for headless Shopify builds. Its hybrid rendering capabilities — static generation for product pages, server-side rendering for search results, and client-side rendering for cart interactions — map naturally to e-commerce requirements. The trade-off is that you build the Shopify integration layer yourself, including cart management, checkout flows, and caching strategies.
Gatsby with Shopify
Gatsby excels at sites where content changes infrequently and build times are acceptable. Static generation produces the fastest possible pages, but large catalogs can result in long build times. Gatsby's source plugin for Shopify handles data syncing, but real-time inventory and pricing require client-side fetching.
Custom Builds with Vue or Svelte
Teams with Vue.js or Svelte expertise can build headless storefronts using Nuxt.js or SvelteKit. The Storefront API is framework-agnostic — any tool that can make GraphQL requests can consume it. The trade-off is a smaller ecosystem of pre-built Shopify components and patterns.
Checkout Considerations
One critical architectural decision involves checkout. Shopify's hosted checkout — the page where customers enter payment information — is highly optimized, PCI-compliant, and supports Shop Pay for accelerated checkout. Most headless implementations redirect to Shopify's hosted checkout, and this is our recommended approach for the majority of stores.
Shopify Plus merchants have the option of using Checkout Extensions to customize the checkout experience or building fully custom checkouts. However, the complexity and compliance requirements of custom checkout builds are significant, and the conversion rate benefits of Shopify's optimized checkout are well-documented.
Performance Architecture
Headless storefronts should be measurably faster than theme-based stores. If they are not, the additional complexity is unjustified. Our performance architecture for headless Shopify includes edge-based rendering using platforms like Vercel or Cloudflare Workers, aggressive caching with stale-while-revalidate strategies, image optimization through Shopify's CDN with responsive srcsets, prefetching product data on collection pages for instant navigation, and streaming server-side rendering for large product pages.
When to Go Headless — And When Not To
Headless is not the right choice for every Shopify store. The additional development and maintenance cost is justified when the brand requires a design language that themes cannot express, the site needs to aggregate content from multiple sources, performance requirements exceed what themes can deliver, or the business needs a mobile app sharing the same backend.
Headless is probably not the right choice when the store has a small catalog and straightforward design requirements, the team does not have frontend development expertise, time-to-market is the primary concern, or the budget does not support ongoing frontend maintenance.
At StrikingWeb, we evaluate each client's situation individually. We have recommended headless builds where the business case was clear, and we have recommended staying with themes (particularly OS 2.0 themes) where they met the requirements. The goal is always the right architecture for the business, not the most technically interesting one.
If you are considering a headless Shopify build, we can help you evaluate whether it is the right approach and, if so, architect a solution that delivers on the promise of performance, flexibility, and design freedom.