Home / Insights / Web and SaaS Development
Web and SaaS Development
Headless Commerce with Shopify Hydrogen or a Custom Storefront: When It Pays Off
Headless Shopify gives you full control of the storefront, but Shopify itself warns that it costs more to build and run than a theme. This guide explains when that extra cost pays off, how Hydrogen compares with a custom storefront, and what you must get right in implementation.
TopicsWeb and SaaS DevelopmentArchitecture and Modernization
Key takeaways
- Start from the theme: go headless only when themes, apps and sales channels genuinely cannot deliver the experience or integration you need.
- Hydrogen on Oxygen is the shortest path to a headless Shopify storefront; a custom stack makes sense when commerce must live inside an existing platform or framework your team already runs.
- Headless moves work from Shopify to you: hosting, caching, SEO, analytics, accessibility and every future change to the storefront become your team’s responsibility.
- Judge the decision on a three-year cost of ownership and a named owning team, not on launch cost or a performance demo.
- Protect the basics Shopify expects: private tokens kept server-side, /products/:handle URLs or redirects, and cart permalinks that keep working.
On this page
- What headless means on Shopify, and what changes
- Theme, Hydrogen or custom storefront: the options compared
- When headless pays off, and when it does not
- How to decide: a cost of ownership view
- How to implement a headless storefront safely
- Risks and running costs to plan for
- Headless commerce decision and launch checklist
- Frequently asked questions
- Sources and methodology
Many merchants consider headless commerce after hitting a limit: a design that themes cannot express, a content-heavy site that needs a proper CMS, or a product experience that must sit inside an existing web platform. Shopify supports this through its Storefront API and through Hydrogen, its own headless framework, hosted on Oxygen. Agencies and platform vendors often present headless as the modern default. It is not, and the cost difference is real.
This article is for ecommerce leads, CTOs and founders deciding whether to move a Shopify store to a headless architecture, or whether to build a new storefront that way. It sets out the options, when each pays off, how to decide, how to implement safely, and the running costs that are easy to underestimate. It reflects how we approach storefront and platform work in our retail and ecommerce practice, where we extend Shopify, build custom storefronts and connect commerce to back-office systems.
What headless means on Shopify, and what changes
In a standard Shopify setup, Shopify renders the storefront from a theme written in Liquid, hosts it and serves it through its CDN. In a headless setup, you build and host the storefront yourself, and Shopify’s APIs supply the commerce data.
According to Shopify’s headless documentation, the main building blocks are:
- Storefront API: products, collections, search and the cart, with customers handed off to Shopify checkout.
- Customer Account API: sign-in, orders, addresses and profiles.
- Hydrogen: Shopify’s toolkit for building a full storefront, with Oxygen as Shopify’s hosting option.
- Bring your own stack: any language or framework calling the APIs directly.
What stays with Shopify
Product and inventory data, pricing, discounts, checkout, payments, orders and the admin all remain in Shopify. Checkout in particular is still Shopify’s, which is usually a good thing: it carries the payment, tax and fraud work you do not want to rebuild.
What moves to you
Everything a theme used to give you for free becomes your responsibility: page rendering, hosting, caching, SEO markup, structured data, analytics events, accessibility, and compatibility with Shopify apps. Many apps assume a theme and inject scripts or blocks into it. In a headless storefront, each app either offers an API you integrate yourself or does not work at all.
Shopify is direct about the trade-off: its documentation states that a headless storefront costs more to build and run than a theme, that the merchant needs to accept that cost, and that developers are needed to maintain the storefront after launch. That sentence should frame every business case.
Theme, Hydrogen or custom storefront: the options compared
There are three realistic paths. The comparison below assumes a mid-sized brand with a design team and at least occasional engineering capacity.
| Factor | Shopify theme | Hydrogen on Oxygen | Custom storefront (own stack) |
|---|---|---|---|
| Who renders and hosts | Shopify | Your code, hosted by Shopify on Oxygen | Your code on your hosting (for example a cloud platform you already use) |
| Framework | Liquid and theme blocks | Built on React Router, with Shopify components and utilities | Any, such as Next.js or a framework your platform already uses |
| App compatibility | Broad | Limited to apps with APIs or Hydrogen support | Limited to apps with APIs |
| Design freedom | High within theme architecture | Full | Full |
| Hosting cost | Included | Oxygen included on paid Shopify plans | Separate hosting and CDN bills |
| Engineering need after launch | Low to moderate | Ongoing | Ongoing, plus infrastructure |
| Best fit | Most stores | Shopify-centric brands that need a bespoke front end | Commerce embedded in a wider platform, multi-system content or non-Shopify parts |
Hydrogen and Oxygen in more detail
The Hydrogen fundamentals documentation describes Hydrogen as built on React Router, which handles routing, data fetching, server-side rendering and styling, with Hydrogen adding Shopify-specific components, API client handling and CLI tooling. Oxygen is Shopify’s serverless platform for deploying storefronts at the edge, running on a worker-based runtime built on Cloudflare’s workerd, and it provides deployment environments, environment variables and CDN integration. Oxygen is included at no extra charge on paid plans, although development stores and trials have no public environments.
There are operational details to plan for. The Oxygen deployments documentation notes that runtime logs are kept for one month, so you need a log drain for longer retention, and that deployments are immutable, keeping their original environment variables until redeployed. A worker runtime also means some Node.js libraries will not run unchanged, which matters if you plan to reuse existing server code.
Custom storefronts
A custom storefront calls the Storefront API and Customer Account API from whatever stack you choose. This is the right path when the storefront is one part of a larger product, for example a marketplace, a content platform or a member portal, and you do not want two front-end stacks. The cost is that you also own hosting, CDN configuration and the operational tooling Oxygen would otherwise provide.
When headless pays off, and when it does not
Shopify’s documentation suggests considering headless when themes, sales channels and apps cannot support the experience you need, when your front-end stack does not use Liquid, or when you need to add commerce to existing infrastructure, sell on unsupported channels or integrate a CMS. In practice, the cases where we see the extra cost earn its keep are narrower.
Signals that headless is likely to pay off
- Content and commerce are equally important. Editorial pages, guides or long-form product storytelling managed in a headless CMS, with products woven through them.
- Commerce lives inside another product. A subscription platform, a membership site or a B2B portal that already has its own front end and authentication.
- Several brands or regions share one front-end codebase with distinct designs and content, and the team wants one component library.
- Interactive product experiences such as configurators, bundles built step by step or visual try-on that themes cannot express without fragile workarounds.
- An engineering team already exists that will own the storefront for years, not just build it.
Signals that a theme is the better answer
- The main complaint is speed, but the store has not been audited for heavy apps, oversized images or third-party scripts.
- The business relies on many theme-based apps for reviews, upsells, loyalty and merchandising.
- Marketing needs to change pages weekly without developer involvement and is happy with the theme editor.
- There is no budget for ongoing engineering after launch.
A common trap is choosing headless to fix performance. A well-built theme can meet Core Web Vitals targets; a poorly built headless storefront can miss them. Google’s guidance on Core Web Vitals sets good thresholds of 2.5 seconds for Largest Contentful Paint, 200 milliseconds for Interaction to Next Paint and 0.1 for Cumulative Layout Shift, measured at the 75th percentile of page loads. Measure your current theme against those numbers before assuming a rebuild is needed.
How to decide: a cost of ownership view
Launch cost dominates most proposals, but it is rarely the larger number over three years. The useful comparison is total cost of ownership and who will carry it.
Cost lines to estimate
| Cost line | Theme | Hydrogen on Oxygen | Custom storefront |
|---|---|---|---|
| Initial build | Theme customisation | Full front-end build | Full front-end build plus infrastructure setup |
| Hosting and CDN | Included | Included on paid plans | Your cloud bill |
| App replacements | Low | Integrate or rebuild app features via APIs | Integrate or rebuild app features via APIs |
| Content tooling | Theme editor | Headless CMS licence and integration, if used | Headless CMS licence and integration, if used |
| Ongoing engineering | Occasional | Continuous: features, framework updates, API version updates | Continuous, plus infrastructure and security patching |
| Monitoring and analytics | Mostly built in | Log drains, analytics events, error tracking | Full observability stack |
A simple decision sequence
- Write down the experience or integration the theme cannot deliver. If you cannot name it specifically, stop here.
- Check whether apps or theme extensions can close the gap. Prototype the hardest requirement in a theme first.
- Name the owning team. Who will maintain the storefront in year two and year three? In-house, a partner on retainer or a dedicated team?
- Estimate three-year cost for each option using the lines above, with your own rates and assumptions written down.
- Choose Hydrogen unless you have a reason not to. If commerce must live inside an existing platform, or you need hosting outside Shopify for compliance or integration reasons, choose a custom storefront.
For example, a fashion brand with two markets, a strong editorial team and an in-house front-end developer might reasonably choose Hydrogen with a headless CMS. A wellness subscription business whose members already log into a Next.js portal might instead embed commerce in that portal using the Storefront API. Both examples are illustrative; the pattern is that the existing team and platform usually decide the answer.
How to implement a headless storefront safely
Once the decision is made, the main risks are losing things the theme did quietly: SEO equity, app features, analytics continuity and accessibility. Plan for them explicitly.
Requirements Shopify sets out
- Keep private tokens on the server. Shopify’s headless documentation says private Storefront API tokens are secrets and must never reach client-side code or mobile apps.
- Preserve product URLs. Product URLs should follow
/products/:handle, or you need redirects from that path. Changing URL structure without redirects throws away search rankings and breaks links in emails and ads. - Support cart permalinks. Marketing campaigns and some integrations rely on links that pre-fill a cart.
- Plan for query limits. Tokenless Storefront API access is limited in query complexity, so heavier pages need authenticated, server-side access.
Architecture decisions to make early
- Rendering and caching: decide which pages are cached at the edge, for how long, and how product and price changes invalidate them. Stale prices and stock are the most visible headless bug.
- Content model: decide what lives in Shopify (products, metafields, metaobjects) and what lives in a CMS, so editors know where to change things.
- Search and merchandising: confirm whether Storefront API search is enough or whether you need a dedicated search service.
- Analytics: define the event model before build, including consent handling, so reporting continues across the switch.
- App inventory: list every app on the current store and decide for each one: integrate via API, rebuild, replace or drop.
Delivery steps
- Audit the current store: traffic, top URLs, apps, Core Web Vitals and conversion baselines.
- Build the hardest page first (usually the product page with variants, bundles or configurators) as a vertical slice.
- Set performance and accessibility budgets and test against them in every release.
- Map and test redirects for every indexed URL before launch.
- Launch to a share of traffic or a single market first, compare conversion and errors, then expand.
Our AI Shopper Simulation Shopify app work is a reminder that storefront changes are best judged by how real shopping journeys behave, not by page speed alone. If you expect AI shopping assistants to visit your store, also review how to prepare an online store for AI shopping agents, since structured product data matters in both architectures.
Risks and running costs to plan for
- Ownership gap after launch. The most common failure is a storefront built by a project team that then leaves. Framework and API updates continue, and an unmaintained storefront degrades quickly. Budget a standing team or retainer from the start.
- Feature regression. Reviews, wishlists, loyalty and personalisation features that came from apps must be rebuilt or integrated. Our guide to e-commerce personalisation covers which features tend to justify that effort.
- Marketing agility. If editors lose the ability to build landing pages themselves, campaigns slow down. A headless CMS with a sensible component library is part of the build, not an extra.
- Runtime constraints. Edge runtimes do not support every Node.js library. Check dependencies early, especially for authentication, PDF generation or image processing.
- Operational visibility. With Oxygen keeping runtime logs for a month, set up a log drain and error tracking before launch, not after the first incident.
- Two content systems. Splitting content between Shopify and a CMS confuses editors unless the rules are written down and enforced in the CMS schema.
If the decision is between a CMS-led site with light commerce and a commerce-led site with editorial content, our comparison of WordPress and headless CMS platforms may help frame the content side.
Headless commerce decision and launch checklist
- The specific experience or integration a theme cannot deliver is written down and agreed.
- The hardest requirement has been prototyped in a theme or with apps before rejecting that route.
- Current Core Web Vitals and conversion baselines are recorded.
- Three-year cost of ownership is estimated for theme, Hydrogen and custom options, with assumptions stated.
- An owning team for years two and three is named and budgeted.
- Hosting choice is made: Oxygen, or your own platform with a clear reason.
- Every current app has a decision: integrate, rebuild, replace or drop.
- Content model agreed between Shopify data and any CMS.
- Private tokens are server-side only; product URLs follow
/products/:handleor redirect; cart permalinks work. - Caching and invalidation rules for prices and stock are defined and tested.
- Analytics event model and consent handling defined before build.
- Redirect map tested for all indexed URLs.
- Phased launch plan with rollback agreed.
Frequently asked questions
Is Hydrogen faster than a Shopify theme?
Not automatically. Hydrogen gives you full control over rendering and caching, which can produce a very fast storefront, but heavy client-side code or poor caching can make it slower than a well-built theme. Measure against Core Web Vitals rather than relying on the architecture.
Do we lose Shopify checkout if we go headless?
No. Shopify’s headless model hands customers off to Shopify checkout through the Storefront API, so payments, taxes and order creation stay with Shopify.
Can we host a Hydrogen storefront somewhere other than Oxygen?
Shopify’s headless documentation says Hydrogen storefronts can be deployed to other hosts, such as Vercel. Oxygen is the integrated option and is included on paid plans, so choose another host only if you have a specific reason, such as an existing platform or compliance requirement.
Will our Shopify apps still work?
Apps that rely on injecting code into a theme will not work as they are. For each app you need an API integration, a rebuilt feature or a replacement. Make the app inventory part of the business case.
How long does a headless rebuild take?
It depends on the number of templates, apps and integrations, and on whether a CMS is involved. Plan it as a phased project with a vertical slice first, rather than estimating from a page count alone.
Can we move back to a theme later?
Yes, because product, order and customer data stay in Shopify. The cost of moving back is mainly rebuilding the front end and any custom features in theme form, so keep business logic out of the storefront where possible.
Sources and methodology
Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.
- Shopify: Headless storefronts overview — accessed 9 November 2026. Headless building blocks, when to consider headless, the statement that headless costs more to build and run than a theme, token handling, URL and cart permalink expectations.
- Shopify: Hydrogen and Oxygen fundamentals — accessed 9 November 2026. Hydrogen built on React Router, Oxygen as a worker-based edge hosting platform, and Oxygen availability on paid plans.
- Shopify: Oxygen deployments — accessed 9 November 2026. Runtime log retention of one month, log drains, and immutable deployments.
- web.dev (Google): Web Vitals — accessed 9 November 2026. Core Web Vitals thresholds for LCP, INP and CLS and the 75th percentile measurement guidance.
Related reading
Continue your research
Is headless the right move for your Shopify store, or would a better theme do the job?
Share your current store, the experience you want and who will run it after launch, and we will give you a straight view on theme, Hydrogen or a custom storefront.
