All posts
Platform migrations

Shopify Hydrogen vs Next.js: Choosing a Headless Storefront

Shopify Hydrogen vs Next.js for a headless store: how to choose by team, content needs, hosting and lock-in, from a Next.js studio that isn't a Shopify partner.

By Mehdi Hassan7 min read

The short answer

Shopify Hydrogen vs Next.js comes down to team and content. Pick Hydrogen for a commerce-first store that lives entirely on Shopify and wants Shopify's hosting and helpers. Pick Next.js when the storefront is content-led, pulls from several data sources, or your team already runs Next.js. Both use the same Storefront API.

Key takeaways

  • Both are React and both call Shopify's Storefront API; the product data and checkout are identical.
  • Hydrogen is Shopify's own framework on React Router, with Oxygen hosting and commerce helpers built in.
  • Next.js wins when content, a headless CMS or non-Shopify data drive the pages.
  • Hiring is easier for Next.js; Shopify-specific shortcuts are better in Hydrogen.
  • If you can't name a reason a theme fails you, you may not need either.

Part of Headless Shopify: When It's Worth It and When It's Not

What's the difference between Shopify Hydrogen and Next.js?

Hydrogen is Shopify's own React framework for building headless storefronts, while Next.js is a general-purpose React framework from Vercel that can power a Shopify storefront among many other things. Both fetch products, collections and carts from Shopify's Storefront API and send shoppers to Shopify's checkout. What differs is who made the tooling, where it's hosted and how much it assumes about your store.

Hydrogen is built on React Router, the framework formerly known as Remix, and ships with commerce components, cart utilities and caching tuned for Shopify. It deploys to Oxygen, Shopify's hosting. Next.js has no opinion about commerce: you add Shopify through its libraries or your own data layer, and you host it on Vercel or any Node or edge platform. If you haven't decided whether to go headless at all, start with our hub on whether headless Shopify is worth it.

A note on bias: we build marketing sites and storefront front ends in Next.js, and we're not a Shopify partner agency. We'll say where Hydrogen is the better pick, because for some stores it clearly is.

Shopify Hydrogen vs NextJS: how do they compare?

Hydrogen is the more convenient choice for a pure Shopify store; Next.js is the more flexible choice for everything around the store. The table compares them on the factors that actually change the decision.

Factor

Hydrogen

Next.js

Maker

Shopify

Vercel, open source

Routing and data

React Router loaders and actions

App Router, server components, route handlers

Shopify helpers

Built in: cart, analytics, SEO and caching utilities

Shopify libraries or your own; more wiring

Hosting

Oxygen, Shopify's hosting

Vercel, Cloudflare, Netlify or your own servers

Non-Shopify data

Possible, less common

Normal: CMS, search, reviews, internal APIs

Hiring pool

Smaller, Shopify-specific

Large, general React and Next.js developers

Lock-in

Tied to Shopify's roadmap and hosting

Portable framework; Shopify is one data source

Best fit

Commerce-first Shopify store

Content-led brand or multi-source storefront

Neither is faster by default. Both can produce very quick storefronts, and both can be slow if you load too much on the client. Performance depends on caching, images and scripts far more than on the framework name. Our guide to Core Web Vitals on Framer, Webflow and Next.js covers the Next.js side of that work.

When is Hydrogen the better choice?

Hydrogen is the better choice when Shopify is the center of everything and your team wants Shopify to own as much of the stack as possible. You get a framework designed around the Storefront API, hosting from the same company that runs your checkout, and patterns that match Shopify's documentation.

  • Your pages are mostly product and collection pages. Content is light and fits in Shopify metaobjects.
  • You want one vendor. Hosting, commerce and framework all come from Shopify, which simplifies support conversations.
  • Your developers are Shopify specialists. Hydrogen's commerce helpers save them real time on carts, variants and analytics.
  • You plan to stay on Shopify for the long term. The lock-in that Hydrogen brings matters less if you'd never move platforms anyway.

The trade-off is that you're following Shopify's framework choices. Hydrogen has already changed its foundation once, from its own early approach to Remix and then React Router, and your team moves when Shopify moves.

When is Next.js the better choice?

Next.js is the better choice when your storefront is really a content site with a shop inside it, or when Shopify is only one of several systems feeding the pages. It's also the safer choice when you want to hire from a wide pool or keep the option of changing commerce platforms later.

  • Content leads. Editorial stories, guides and campaigns sit next to products, managed in a headless CMS.
  • You combine data sources. Search, reviews, a PIM, a CMS and internal APIs all feed the same page.
  • You already run Next.js. Your marketing site, docs or app are on Next.js, so one team and one set of patterns covers it all.
  • You want portability. Shopify becomes a data source rather than the foundation, so a future change of commerce engine doesn't mean a new framework.

The cost is more wiring. You'll build or adopt the cart, analytics and caching layers that Hydrogen hands you. Teams that design in Figma and build in Next.js often find this worth it, and our guide on Figma to Next.js shows how that handoff works.

How do hosting, cost and lock-in differ?

Hosting is the clearest practical difference: Hydrogen deploys to Oxygen, which Shopify includes with most plans, while Next.js runs on a host you choose and pay for separately. Check Shopify's current plan pages for Oxygen's terms, and your host's pricing for traffic-based costs, because both change.

Build cost is closer than people expect. The expensive parts of any headless storefront are the same in both: design, rebuilding app features, tracking, URL mapping and QA. Hydrogen saves some time on commerce plumbing; Next.js saves time when content and other data are central. Our headless Shopify cost guide covers the ranges and what drives them.

Lock-in runs in different directions. Hydrogen ties you to Shopify's framework and hosting. Next.js ties you to whichever host features you adopt, though it remains portable. In both cases, your bigger lock-in is the custom code you write, so keep it clean and documented.

Hypothetical example: two brands, two answers

For example, suppose two brands are going headless. The first sells one product line, has a small catalog, publishes little content and has a Shopify-specialist developer on staff. Hydrogen fits: the developer gets commerce helpers, Shopify hosts it, and there's no CMS to integrate.

The second publishes weekly stories, recipes and guides that feature products, runs its marketing site on Next.js already and uses a headless CMS. Next.js fits: one framework covers content and commerce, and the same team maintains both. Same Storefront API, different best answer.

Do you need either one?

Many stores don't need either, because a strong theme plus custom landing pages solves the actual problem. Before picking a framework, make sure headless itself is justified by content, integration or multi-storefront needs, and that someone will maintain the storefront after launch.

If you're already headless and the upkeep outweighs the benefit, the honest move might be going back to a theme; we cover that in when to undo headless. And if you're comparing the full cost of each route, our DTC website cost guide puts theme, custom theme and headless side by side. If the decision is go, our guide to migrating a Shopify theme store to headless covers the cutover.

Frequently asked questions

Is Hydrogen free to use?
Hydrogen itself is open source and free to use. Oxygen hosting is included with most Shopify plans, so many stores don't pay separately for hosting a Hydrogen storefront. The real costs are development and maintenance. Check Shopify's current plan and Oxygen pages for any limits or plan requirements, since those terms can change and may affect larger or high-traffic stores.
Can you host Hydrogen somewhere other than Oxygen?
Hydrogen is designed for Oxygen, and that's the path Shopify documents and supports best. Because it's built on React Router, it can be deployed to other hosts with adapters, but you take on more setup and lose some of the integration. If hosting flexibility matters a lot to you, that's a point in favor of Next.js, which is built to run on many platforms.
Is there a Next.js starter for Shopify?
Yes. Vercel maintains Next.js Commerce, an open-source storefront template that works with Shopify, and there are other community starters. A starter is useful for learning the data patterns and getting a prototype running, but most brands outgrow it quickly. Treat it as a reference for structure, not as a finished store, and budget for custom design and app integrations.
Which is better for SEO, Hydrogen or Next.js?
Neither has an inherent SEO advantage. Both render pages on the server, so search engines get full HTML, and both let you control metadata, structured data and URLs. SEO results depend on content, internal linking, speed and a clean migration with one-to-one redirects. Pick the framework for team and content fit, then follow SEO basics carefully in either one.
Can you switch from Hydrogen to Next.js later?
You can, but it's a rebuild of the front end rather than a simple port. Both are React, so some components and styles carry over, while routing, data loading and Hydrogen-specific helpers need rewriting. Your Shopify data and checkout stay the same, and with careful URL planning the SEO risk is manageable. Choose deliberately up front to avoid paying for the front end twice.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Website, $8,000.

A multi-page marketing site, written and designed by us, developed in Next.js and animated. $8,000, one-time, up to 6 pages. Book a free 30-minute call to see if it fits.

Schedule Call