Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Next.js commerce storefront starter with Hygraph CMS, Stripe Checkout, Tailwind CSS, and SEO-ready pre-rendered pages.
The Hygraph Commerce Starter is an open-source Next.js ecommerce storefront template that pairs Hygraph as a headless CMS, Stripe for hosted payments, and Tailwind CSS for styling. It gives developers a fully functioning commerce site with a localized product catalogue, pre-rendered pages, a client-side shopping cart, and server-side order creation triggered by Stripe webhooks.
The Hygraph Commerce Starter is a reference application that demonstrates how to build a production-style commerce storefront on the Next.js framework. It takes a Hygraph project created from the Commerce Starter template and a Stripe account as inputs, and outputs a deployable storefront with product pages, a cart, and a hosted checkout flow. The project was created by Hygraph (formerly GraphCMS) and is published on GitHub under the Hygraph organization.
getStaticProps and getStaticPaths for fast loads and SEO.react-use-cart library keeps the cart state on the client and supports multiple languages.checkout.session.completed event calls a Next.js API Route, which uses the Hygraph mutation API to create an order in the CMS.hygraph.config.js and are reflected throughout the storefront.hygraph.config.js and the starter serves localized product pages using Next.js i18n routing.degit and install dependencies with npm.checkout.session.completed, supplying the signing secret.hygraph.config.js to match the enabled locales and currencies in your Hygraph project.npm run dev to start the Next.js development server and browse the storefront.Yes. The usage section states that the reference application requires a Stripe account because payment processing uses Stripe Checkout and webhooks for order creation.
The .env file requires HYGRAPH_MUTATION_TOKEN, HYGRAPH_QUERY_TOKEN, HYGRAPH_ENDPOINT, NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY, STRIPE_SECRET_KEY, and STRIPE_WEBHOOK_SIGNING_SECRET.
Products are managed in Hygraph using the Commerce Starter content schema. The starter statically generates pages from this content at build time, and uses SWR for client-side updates when the data changes.
Yes. The hygraph.config.js file defines the locales and currencies array. The locales must match the enabled locales in your Hygraph project to work correctly.
