MCPcopy
hub / github.com/vercel/commerce

github.com/vercel/commerce @main sqlite

repository ↗ · DeepWiki ↗
115 symbols 315 edges 66 files 0 documented · 0%
README

Deploy with Vercel

Next.js Commerce

A high-performance, server-rendered Next.js App Router ecommerce application.

This template uses React Server Components, Server Actions, Suspense, useOptimistic, and more.

Note: Looking for Next.js Commerce v1? View the code, demo, and release notes.

Providers

Vercel will only be actively maintaining a Shopify version as outlined in our vision and strategy for Next.js Commerce.

Vercel is happy to partner and work with any commerce provider to help them get a similar template up and running and listed below. Alternative providers should be able to fork this repository and swap out the lib/shopify file with their own implementation while leaving the rest of the template mostly unchanged.

Note: Providers, if you are looking to use similar products for your demo, you can download these assets.

Integrations

Integrations enable upgraded or additional functionality for Next.js Commerce

  • Orama (Demo)

  • Upgrades search to include typeahead with dynamic re-rendering, vector-based similarity search, and JS-based configuration.

  • Search runs entirely in the browser for smaller catalogs or on a CDN for larger.

  • React Bricks (Demo)

  • Edit pages, product details, and footer content visually using React Bricks visual headless CMS.

Running locally

You will need to use the environment variables defined in .env.example to run Next.js Commerce. It's recommended you use Vercel Environment Variables for this, but a .env file is all that is necessary.

Note: You should not commit your .env file or it will expose secrets that will allow others to control your Shopify store.

  1. Install Vercel CLI: npm i -g vercel
  2. Link local instance with Vercel and GitHub accounts (creates .vercel directory): vercel link
  3. Download your environment variables: vercel env pull
pnpm install
pnpm dev

Your app should now be running on localhost:3000.

Expand if you work at Vercel and want to run locally and / or contribute

  1. Run vc link.
  2. Select the Vercel Solutions scope.
  3. Connect to the existing commerce-shopify project.
  4. Run vc env pull to get environment variables.
  5. Run pnpm dev to ensure everything is working correctly.

Vercel, Next.js Commerce, and Shopify Integration Guide

You can use this comprehensive integration guide with step-by-step instructions on how to configure Shopify as a headless CMS using Next.js Commerce as your headless Shopify storefront on Vercel.

Extension points exported contracts — how you extend this code

ShopifyErrorLike (Interface)
(no doc)
lib/type-guards.ts

Core symbols most depended-on inside this repo

removeEdgesAndNodes
called by 7
lib/shopify/index.ts
reshapeCart
called by 5
lib/shopify/index.ts
getCart
called by 4
lib/shopify/index.ts
OpengraphImage
called by 3
components/opengraph-image.tsx
updateImage
called by 3
components/product/gallery.tsx
createUrl
called by 3
lib/utils.ts
reshapeProducts
called by 3
lib/shopify/index.ts
getCollectionProducts
called by 3
lib/shopify/index.ts

Shape

Function 114
Interface 1

Languages

TypeScript100%

Modules by API surface

lib/shopify/index.ts23 symbols
components/cart/cart-context.tsx9 symbols
components/cart/modal.tsx5 symbols
components/cart/actions.ts5 symbols
lib/type-guards.ts4 symbols
components/layout/navbar/mobile-menu.tsx4 symbols
lib/utils.ts3 symbols
components/layout/search/filter/item.tsx3 symbols
app/product/[handle]/page.tsx3 symbols
components/product/variant-selector.tsx2 symbols
components/product/gallery.tsx2 symbols
components/layout/search/filter/index.tsx2 symbols

Dependencies from manifests, versioned

@headlessui/react2.2.0 · 1×
@heroicons/react2.2.0 · 1×
@tailwindcss/container-queries0.1.1 · 1×
@tailwindcss/typography0.5.16 · 1×
@types/node22.13.10 · 1×
@types/react19.0.12 · 1×
@types/react-dom19.0.4 · 1×
clsx2.1.1 · 1×
geist1.3.1 · 1×
next15.6.0-canary.60 · 1×
postcss8.5.3 · 1×

For agents

$ claude mcp add commerce \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact