Skip to content
VercelLogotypeVercelLogotype
LoginSign Up

Next.js Saleor Commerce

Saleor Storefront built with React 18, Next.js 14, App Router, TypeScript, GraphQL, and Tailwind CSS.

DeployView Demo



Paper

A minimal, production-ready storefront template for Saleor.
Clean as a blank page — built to ship with agents and humans.


Learn about headless storefronts · Website · Docs · Discord

[!TIP] Questions or issues? Check our Discord for help.


Why Paper?

Ship faster, customize everything. Paper is a new release—expect some rough edges—but every component is built with real-world e-commerce in mind. This is a foundation you can actually build on.

🛒 Open Checkout

The checkout is where most storefronts fall apart or fall short. Paper's doesn't. We aim to provide open UI components and full wiring around the whole process.

  • Multi-step, mobile-first — Each step is a focused form. No infinite scrolling on phones.
  • Guest & authenticated — Seamless flow for everyone. Logged-in users get address book and saved preferences.
  • International address forms — Country-aware fields that adapt (US states, UK postcodes, German formats).
  • Connection resilience — Automatic retries with exponential backoff. Flaky networks? Handled.
  • Componentized architecture — Swap steps, add steps, remove steps. It's your checkout.
  • Multi-channel ready — Different currencies and shipping zones per channel.

🌍 Multi-Channel, Multi-Currency

One codebase, many storefronts. Channel-scoped routing means /us/products and /eu/products can serve different catalogs, prices, and shipping options—all from the same deployment.

Storefront channels are explicit. Saleor may have many channels (B2B, wholesale, internal regions); Paper only exposes the slugs you configure via STOREFRONT_CHANNELS. Disallowed channel URLs return 404. For a single-channel store, set NEXT_PUBLIC_DEFAULT_CHANNEL only—the footer channel selector is hidden automatically.

📱 Product Pages Done Right

The hard parts are solved. Adapt the look, keep the logic.

  • Partial Prerendering (PPR) — Product name, attributes, and SEO stay in a static cached shell; variant gallery and add-to-cart stream in via Suspense when searchParams change.
  • Multi-attribute variant selection — Color + Size + Material? Handled. Complex variant matrices just work.
  • Dynamic pricing — Sale prices, variant-specific pricing, channel pricing—all reactive.
  • Image gallery — Next.js Image optimization, proper aspect ratios, keyboard navigation.

♿ Accessibility Built In

Not an afterthought. Focus management on step transitions, keyboard navigation everywhere, semantic HTML, proper ARIA labels. Everyone deserves to shop.

🤖 AI-Ready Codebase

Built for front-end developers and AI agents. The codebase includes:

  • AGENTS.md — Architecture overview and quick reference for AI assistants
  • skills/saleor-paper-storefront/ [blocked] — 13 task-specific rules covering GraphQL, caching, variant selection, checkout, and more
  • saleor/agent-skills — Universal Saleor API patterns; install additional skills (React best practices, composition patterns) via npx skills add
  • Consistent patterns — Predictable structure that AI tools can navigate and modify confidently

Whether you're pair-programming with Cursor, Claude, or Copilot—the codebase is designed to help them help you.

⚡ Bleeding Edge Stack

  • Next.js 16 with App Router and Server Components
  • React 19 with the latest concurrent features
  • TypeScript in strict mode—your IDE will thank you
  • Tailwind CSS with design tokens (OKLCH colors, CSS variables)
  • GraphQL Codegen for type-safe Saleor API calls

What's in the Box

FeatureDescription
CheckoutMulti-step flow with guest/auth support, address selector, international forms
CartSlide-over drawer with real-time updates, quantity editing
Product PagesMulti-attribute variants, image gallery, sticky add-to-cart
Product ListingsCategory & collection pages with PPR (cached hero + dynamic filters), pagination
NavigationDynamic menus from Saleor, mobile hamburger
SEOMetadata, JSON-LD, Open Graph images
CachingCache Components (PPR), named cacheLife tiers, channel-scoped tags, webhooks
Saleor Cloud Paper appSaleor Cloud only — Dashboard extension for cache invalidation webhooks and Preview in storefront
Customer ProfileAccount dashboard, address book, order history, password change, account deletion
AuthenticationLogin, register, password reset, guest checkout
API ResilienceAutomatic retries, rate limiting, timeouts—handles flaky connections gracefully

Caching Architecture

Paper uses Cache Components (Partial Prerendering) for optimal performance—static shells load instantly while dynamic content streams in. Learn more in the Next.js documentation or see skills/saleor-paper-storefront/rules/data-caching.md [blocked] for project-specific implementation details.

The display-cached, checkout-live model ensures fast browsing with accurate checkout:

┌─────────────────────────────────────────────────────────────────────┐
│ DATA FRESHNESS │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ Product Pages Cart / Checkout Payment │
│ ────────────── ────────────── ─────── │
│ │
│ ┌───────────┐ ┌───────────┐ ┌───────────┐ │
│ │ CACHED │────────▶│ LIVE │─────────▶│ LIVE │ │
│ │ 5 min │ Add │ Always │ Pay │ Always │ │
│ └───────────┘ to └───────────┘ └───────────┘ │
│ Cart │
│ Fast page loads Real-time prices Saleor validates │
│ │
└─────────────────────────────────────────────────────────────────────┘

How It Works

ComponentFreshnessWhy
Product pagesCached (catalog)Static shell + dynamic variant islands (PPR)
Category/CollectionCached (catalog)Cached hero from params; filters/pagination stream in Suspense
Homepage featuredCached (catalog)Sync page shell; product grid streams in nested Suspense
Navigation / footerCached (menus)Per-channel tags: navigation:{channel}, footer-menu:{channel}
Cart drawerAlways liveSaleor API with cache: "no-cache"
CheckoutAlways liveDirect API calls, real-time totals

cacheLife tiers (see src/lib/cache-life-profiles.ts):

ProfileFallback TTLUsed for
catalog~5 minProducts, categories, collections, homepage
menus~1 hrHeader nav, footer menu
channels~1 dayFooter channel metadata

Webhook revalidateTag(tag, profile) clears data immediately; TTL is the safety net when webhooks are missing.

PPR page patterns

Cached GraphQL lives in src/lib/catalog/, src/lib/menus/, and src/lib/channels/ — not in layout or page components. Pages are thin orchestrators with nested <Suspense> for dynamic islands.

PDP — params only in the static shell; gallery and variant selection read searchParams:

ProductPage (sync)
└── ProductShell → getProductData "use cache"
├── h1, attributes, JSON-LD, LCP preload
├── Suspense → VariantGalleryDynamic (searchParams)
└── Suspense → VariantSectionDynamic (searchParams)

PLP (category, collection, all products) — cached hero/metadata from params; filter/sort/pagination in a dynamic grid:

Page
├── CategoryHero ← getCategoryData "use cache"
└── Suspense → CategoryProducts (searchParams, always fresh fetch)

Homepage — sync <section> shell; featured collection grid in nested Suspense.

Loading UX — route-level loading.tsx files (products, categories, collections) show skeletons during navigation. The main layout does not wrap {children} in Suspense fallback={null}.

Cache tags (see src/lib/cache-manifest.ts):

Tag patternInvalidated when
product:{slug}Product updated
category:{slug}Category updated
collection:{slug}Collection updated
navigation:{channel}Main menu changed for channel
footer-menu:{channel}Footer menu changed for channel
channelsChannel list metadata

Featured homepage products use tag collection:featured-products (same catalog profile as collections).

Instant Updates with Webhooks

Saleor Cloud (recommended): Install the Saleor Cloud Paper app from Dashboard → Extensions. Available on Saleor Cloud only for now. It registers revalidation webhooks for products, categories, collections, pages, menus, and promotions; discovers cache tags via /api/cache-info; and adds Preview in storefront on product pages in Dashboard.

Self-hosted / manual setup:

  1. Create webhooks in Saleor Dashboard → Configuration → Webhooks
  2. Point to https://your-store.com/api/revalidate
  3. Subscribe to product/category/collection/page events; for menus use MENU_* / MENU_ITEM_* and include { menu: { slug } } for navbar and footer menus
  4. Set SALEOR_WEBHOOK_SECRET env var

Manual revalidation (requires REVALIDATE_SECRET):

# Single product
curl "https://your-store.com/api/revalidate?secret=xxx&tag=product:blue-hoodie"
# CMS page (tag only — invalidates getPageData across channels)
curl "https://your-store.com/api/revalidate?secret=xxx&tag=page:about-us"
# Navigation for one channel (tag or tag + channel query)
curl "https://your-store.com/api/revalidate?secret=xxx&tag=navigation:us"
curl "https://your-store.com/api/revalidate?secret=xxx&tag=navigation&channel=us"
# All tags for every storefront channel
curl "https://your-store.com/api/revalidate?secret=xxx&all=1"

Without webhooks? TTL handles it—cached data expires per the catalog / menus / channels profiles above.

Why This Is Safe

  • Saleor is the source of truth: checkoutLinesAdd calculates prices server-side
  • Cart always fetches fresh: Users see current prices before checkout
  • Payment validates: checkoutComplete uses real-time data

📚 Deep dive: See skills/saleor-paper-storefront/rules/data-caching.md [blocked] for the full architecture, Cache Components (PPR), webhook setup, and debugging guide.


Quick Start

[!NOTE] New to Saleor? Check out saleor.io/start to learn how storefronts work underneath.

1. Get a Saleor Backend

Option A: Free Saleor Cloud account (recommended)

Option B: Run locally with Docker

2. Clone & Configure

# Using Saleor CLI (recommended)
npm i -g @saleor/cli@latest
saleor storefront create --url https://{YOUR_INSTANCE}/graphql/
# Or manually
git clone https://github.com/saleor/storefront.git
cd storefront
cp .env.example .env
pnpm install

Edit .env with your Saleor instance details:

NEXT_PUBLIC_SALEOR_API_URL=https://your-instance.saleor.cloud/graphql/
NEXT_PUBLIC_DEFAULT_CHANNEL=default-channel # Your Saleor channel slug

Multi-channel (recommended — explicit allowlist):

STOREFRONT_CHANNELS=us,uk,eu
NEXT_PUBLIC_DEFAULT_CHANNEL=us
SALEOR_APP_TOKEN=... # Server-side only — footer currency selector metadata

Finding your channel slug: In Saleor Dashboard → Configuration → Channels → copy the slug

Note: SALEOR_APP_TOKEN alone no longer auto-discovers every Saleor channel. Set STOREFRONT_CHANNELS or opt in with STOREFRONT_DISCOVER_CHANNELS=true (see Environment Variables).

3. Run

pnpm dev

Open localhost:3000. That's it.


Development

Commands

pnpm dev # Start dev server
pnpm build # Production build
pnpm run generate # Regenerate GraphQL types (storefront)
pnpm run generate:checkout # Regenerate GraphQL types (checkout)

Project Structure

src/
├── app/ # Next.js App Router
│ ├── [channel]/ # Channel-scoped routes
│ └── checkout/ # Checkout pages
├── checkout/ # Checkout components & logic
├── graphql/ # GraphQL queries
├── gql/ # Generated types (don't edit)
├── lib/ # Server utilities & cached data layer
│ ├── catalog/ # getCategoryData, getCollectionData, getFeaturedProducts
│ ├── menus/ # getNavbarMenuItems, getFooterMenuItems
│ ├── channels/ # getCachedChannelsList
│ ├── cache-manifest.ts # Tag registry + cacheLife mapping
│ └── cache-life-profiles.ts
├── ui/components/ # UI components
│ ├── account/ # Customer profile & address book
│ ├── pdp/ # Product detail page
│ ├── plp/ # Product listing page
│ ├── cart/ # Cart drawer
│ └── ui/ # Primitives (Button, Badge, etc.)
└── styles/brand.css # Design tokens

For AI Agents

If you're working with AI coding assistants, point them to:

  • AGENTS.md — Architecture, commands, gotchas
  • skills/saleor-paper-storefront/ — 13 project-specific rules (GraphQL, caching, checkout, etc.)
  • saleor/agent-skills — Universal Saleor patterns and optional community skills (React best practices, composition patterns, etc.)

To install skills for agent auto-discovery:

# Project skill (already in this repo)
npx skills add . --skill saleor-paper-storefront
# Universal Saleor API patterns
npx skills add saleor/agent-skills --skill saleor-storefront

Environment Variables

# Required
NEXT_PUBLIC_SALEOR_API_URL=https://your-instance.saleor.cloud/graphql/
NEXT_PUBLIC_DEFAULT_CHANNEL=default-channel # Fallback channel; root "/" redirects here
# Multi-channel (recommended)
STOREFRONT_CHANNELS=us,uk,eu # Comma-separated allowlist — routes, revalidation, footer
# Optional
NEXT_PUBLIC_STOREFRONT_URL= # Canonical URLs and OG images
REVALIDATE_SECRET= # Manual cache invalidation (GET /api/revalidate)
SALEOR_WEBHOOK_SECRET= # Webhook HMAC verification
SALEOR_APP_TOKEN= # Server-side: footer channel metadata (never exposed to client)
STOREFRONT_DISCOVER_CHANNELS=true # Opt-in: discover ALL active Saleor channels from API
# (not recommended when Saleor has many channels; prefer STOREFRONT_CHANNELS)

Channel resolution order (getStorefrontChannelSlugs):

  1. STOREFRONT_CHANNELS — explicit allowlist (recommended)
  2. STOREFRONT_DISCOVER_CHANNELS=true + SALEOR_APP_TOKEN — all active channels from API
  3. NEXT_PUBLIC_DEFAULT_CHANNEL only — single-channel storefront

Payments

The checkout architecture supports Saleor payment apps like Adyen and Stripe. The heavy lifting is done—integrating your gateway requires minimal work compared to building from scratch.


Customization

Paper works as a reference implementation and as a starting point for your own storefront. Start here:

  • Colors & typography → src/styles/brand.css
  • Components → src/ui/components/
  • Checkout flow → src/checkout/views/SaleorCheckout/

The design token system uses CSS custom properties—swap the entire color palette by editing a few lines.


Next Steps

Features planned for future development:

  • Filtering logic iteration. Fetching attributes from API for dynamic product filters.
  • Opinionated model for standard content. Moving currently hardcoded stuff like Credibility or Free checkout information to API models.

License

FSL-1.1-ALv2 (Functional Source License, Version 1.1, ALv2 Future License) — use it, modify it, ship it. Build your storefront, run your business. The license converts to Apache 2.0 after two years.

Want to offer it as a managed service? Let's talk.



Built with 🖤 by the Saleor team

GitHub Reposaleor/storefront
Use Cases
Ecommerce
Stack
Next.js
Tailwind

Related Templates

Next.js Boilerplate

Get started with Next.js and React in seconds.
Next.js Boilerplate thumbnail

Next.js Commerce

Starter kit for high-performance commerce with Shopify.
Next.js Commerce thumbnail

Get Started

  • Templates
  • Supported frameworks
  • Marketplace
  • Domains

Build

  • Next.js on Vercel
  • Turborepo
  • v0

Scale

  • Content delivery network
  • Fluid compute
  • CI/CD
  • Observability
  • AI GatewayNew
  • Vercel AgentNew

Secure

  • Platform security
  • Web Application Firewall
  • Bot management
  • BotID
  • SandboxNew

Resources

  • Pricing
  • Customers
  • Enterprise
  • Articles
  • Startups
  • Solution partners

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Community

Frameworks

  • Next.js
  • Nuxt
  • Svelte
  • Nitro
  • Turbo

SDKs

  • AI SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDK
  • Streamdown AINew

Use Cases

  • Composable commerce
  • Multi-tenant platforms
  • Web apps
  • Marketing sites
  • Platform engineers
  • Design engineers

Company

  • About
  • Careers
  • Help
  • Press
  • Legal
  • Privacy Policy

Community

  • Open source program
  • Events
  • Shipped on Vercel
  • GitHub
  • LinkedIn
  • X
  • YouTube
    VercelVercel
    • AI Cloud
      • AI Gateway

        One endpoint, all your models

      • Sandbox

        Isolated, safe code execution

      • Vercel Agent

        An agent that knows your stack

      • AI SDK

        The AI Toolkit for TypeScript

      • v0

        Build applications with AI

    • Core Platform
      • CI/CD

        Helping teams ship 6× faster

      • Content Delivery

        Fast, scalable, and reliable

      • Fluid Compute

        Servers, in serverless form

      • Workflow

        Long-running workflows at scale

      • Observability

        Trace every step

    • Security
      • Bot Management

        Scalable bot protection

      • BotID

        Invisible CAPTCHA

      • Platform Security

        DDoS Protection, Firewall

      • Web Application Firewall

        Granular, custom protection

    • Company
      • Customers

        Trusted by the best teams

      • Blog

        The latest posts and changes

      • Changelog

        See what shipped

      • Press

        Read the latest news

      • Events

        Join us at an event

    • Learn
      • Docs

        Vercel documentation

      • Academy

        Linear courses to level up

      • Knowledge Base

        Find help quickly

      • Community

        Join the conversation

    • Open Source
      • Next.js

        The native Next.js platform

      • Nuxt

        The progressive web framework

      • Svelte

        The web’s efficient UI framework

      • Turborepo

        Speed with Enterprise scale

    • Use Cases
      • AI Apps

        Deploy at the speed of AI

      • Composable Commerce

        Power storefronts that convert

      • Marketing Sites

        Launch campaigns fast

      • Multi-tenant Platforms

        Scale apps with one codebase

      • Web Apps

        Ship features, not infrastructure

    • Tools
      • Marketplace

        Extend and automate workflows

      • Templates

        Jumpstart app development

      • Partner Finder

        Get help from solution partners

    • Users
      • Platform Engineers

        Automate away repetition

      • Design Engineers

        Deploy for every idea

  • Enterprise
  • Pricing
Log InContact
Sign Up
Sign Up
ContactDashboard
DeployView Demo

Loading status…

Select a display theme:
AI Gateway

One endpoint, all your models

Sandbox

Isolated, safe code execution

Vercel Agent

An agent that knows your stack

AI SDK

The AI Toolkit for TypeScript

v0

Build applications with AI

CI/CD

Helping teams ship 6× faster

Content Delivery

Fast, scalable, and reliable

Fluid Compute

Servers, in serverless form

Workflow

Long-running workflows at scale

Observability

Trace every step

Bot Management

Scalable bot protection

BotID

Invisible CAPTCHA

Platform Security

DDoS Protection, Firewall

Web Application Firewall

Granular, custom protection

Customers

Trusted by the best teams

Blog

The latest posts and changes

Changelog

See what shipped

Press

Read the latest news

Events

Join us at an event

Docs

Vercel documentation

Academy

Linear courses to level up

Knowledge Base

Find help quickly

Community

Join the conversation

Next.js

The native Next.js platform

Nuxt

The progressive web framework

Svelte

The web’s efficient UI framework

Turborepo

Speed with Enterprise scale

AI Apps

Deploy at the speed of AI

Composable Commerce

Power storefronts that convert

Marketing Sites

Launch campaigns fast

Multi-tenant Platforms

Scale apps with one codebase

Web Apps

Ship features, not infrastructure

Marketplace

Extend and automate workflows

Templates

Jumpstart app development

Partner Finder

Get help from solution partners

Platform Engineers

Automate away repetition

Design Engineers

Deploy for every idea