The all-in-one starter kit for high-performance e-commerce sites. With a few clicks, Next.js developers can clone, deploy and fully customize their own store. Start right now at nextjs.org/commerce
Demo live at: demo.vercel.store
To run a minimal version of Next.js Commerce you can start with the default local provider
@vercel/commerce-localthat has disabled all features (cart, auth) and use static files for the backend
pnpm install & pnpm build # run this commands in root folder of the mono repo pnpm dev # run this commands in the site folder
If you encounter any problems while installing and running for the first time, please see the Troubleshoot section
Next.js Commerce integrates out-of-the-box with BigCommerce, Shopify, Swell, Saleor, Vendure, Spree and Commerce.js. We plan to support all major ecommerce backends.
packages/commerce contains all types, helpers and functions to be used as base to build a new provider.packages's root folder and they will extend Next.js Commerce types and functionality (packages/commerce).features in commerce.config.json and if needed it can also be accessed programatically.next.config.js and commerce.config.json adding specific data related to the provider. For example in case of BigCommerce, the images CDN and additional API routes.Open site/.env.local and change the value of COMMERCE_PROVIDER to the provider you would like to use, then set the environment variables for that provider (use site/.env.template as the base).
The setup for Shopify would look like this for example:
COMMERCE_PROVIDER=@vercel/commerce-shopify NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com
Every provider defines the features that it supports under packages/{provider}/src/commerce.config.json
The following features can be enabled or disabled. This means that the UI will remove all code related to the feature.
For example: Turning cart off will disable Cart capabilities.
NOTE: The selected provider should support the feature that you are toggling. (This means that you can't turn wishlist on if the provider doesn't support this functionality out the box)
site/commerce.config.json{ "features": { "wishlist": false, "customCheckout": true } }
wishlist on by setting wishlist to true.Follow our docs for Adding a new Commerce Provider.
If you succeeded building a provider, submit a PR with a valid demo and we'll review it asap.
Our commitment to Open Source can be found here.
git checkout -b MY_BRANCH_NAMEpnpm installpnpm buildsite/.env.template and rename it to site/.env.localsite/.env.localcd site & pnpm dev to watch for code changespnpm turbo run build to check the build after your changesWe're using Github Projects to keep track of issues in progress and todo's. Here is our Board
People actively working on this project: @okbel, @lfades, @dominiksipowicz, @gbibeaul.
BIGCOMMERCE_STOREFRONT_API_URL=<> BIGCOMMERCE_STOREFRONT_API_TOKEN=<> BIGCOMMERCE_STORE_API_URL=<> BIGCOMMERCE_STORE_API_TOKEN=<> BIGCOMMERCE_STORE_API_CLIENT_ID=<> BIGCOMMERCE_CHANNEL_ID=<>
If your project was started with a "Deploy with Vercel" button, you can use Vercel's CLI to retrieve these credentials.
npm i -g vercelvercel linkvercel env pull .env.localNext, you're free to customize the starter. More updates coming soon. Stay tuned..
commerce/site ❯ yarn dev yarn run v1.22.17 $ next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from /commerce/site/.env.local error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error Error: Cannot find module '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/dist/config.cjs' at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15) at resolveExports (node:internal/modules/cjs/loader:482:14) at Function.Module._findPath (node:internal/modules/cjs/loader:522:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) at Function.mod._resolveFilename (/Users/dom/work/vercel/commerce/node_modules/next/dist/build/webpack/require-hook.js:179:28) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/Users/dom/work/vercel/commerce/site/commerce-config.js:9:14) { code: 'MODULE_NOT_FOUND', path: '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/package.json' } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The error usually occurs when running pnpm dev inside of the /site/ folder after installing a fresh repository.
In order to fix this, run pnpm build in the monorepo root folder first.
Using
pnpm devfrom the root is recommended for developing, which will run watch mode on all packages.
An all-in-one starter kit for high-performance e-commerce sites.
The all-in-one starter kit for high-performance e-commerce sites. With a few clicks, Next.js developers can clone, deploy and fully customize their own store. Start right now at nextjs.org/commerce
Demo live at: demo.vercel.store
To run a minimal version of Next.js Commerce you can start with the default local provider
@vercel/commerce-localthat has disabled all features (cart, auth) and use static files for the backend
pnpm install & pnpm build # run this commands in root folder of the mono repo pnpm dev # run this commands in the site folder
If you encounter any problems while installing and running for the first time, please see the Troubleshoot section
Next.js Commerce integrates out-of-the-box with BigCommerce, Shopify, Swell, Saleor, Vendure, Spree and Commerce.js. We plan to support all major ecommerce backends.
packages/commerce contains all types, helpers and functions to be used as base to build a new provider.packages's root folder and they will extend Next.js Commerce types and functionality (packages/commerce).features in commerce.config.json and if needed it can also be accessed programatically.next.config.js and commerce.config.json adding specific data related to the provider. For example in case of BigCommerce, the images CDN and additional API routes.Open site/.env.local and change the value of COMMERCE_PROVIDER to the provider you would like to use, then set the environment variables for that provider (use site/.env.template as the base).
The setup for Shopify would look like this for example:
COMMERCE_PROVIDER=@vercel/commerce-shopify NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com
Every provider defines the features that it supports under packages/{provider}/src/commerce.config.json
The following features can be enabled or disabled. This means that the UI will remove all code related to the feature.
For example: Turning cart off will disable Cart capabilities.
NOTE: The selected provider should support the feature that you are toggling. (This means that you can't turn wishlist on if the provider doesn't support this functionality out the box)
site/commerce.config.json{ "features": { "wishlist": false, "customCheckout": true } }
wishlist on by setting wishlist to true.Follow our docs for Adding a new Commerce Provider.
If you succeeded building a provider, submit a PR with a valid demo and we'll review it asap.
Our commitment to Open Source can be found here.
git checkout -b MY_BRANCH_NAMEpnpm installpnpm buildsite/.env.template and rename it to site/.env.localsite/.env.localcd site & pnpm dev to watch for code changespnpm turbo run build to check the build after your changesWe're using Github Projects to keep track of issues in progress and todo's. Here is our Board
People actively working on this project: @okbel, @lfades, @dominiksipowicz, @gbibeaul.
BIGCOMMERCE_STOREFRONT_API_URL=<> BIGCOMMERCE_STOREFRONT_API_TOKEN=<> BIGCOMMERCE_STORE_API_URL=<> BIGCOMMERCE_STORE_API_TOKEN=<> BIGCOMMERCE_STORE_API_CLIENT_ID=<> BIGCOMMERCE_CHANNEL_ID=<>
If your project was started with a "Deploy with Vercel" button, you can use Vercel's CLI to retrieve these credentials.
npm i -g vercelvercel linkvercel env pull .env.localNext, you're free to customize the starter. More updates coming soon. Stay tuned..
commerce/site ❯ yarn dev yarn run v1.22.17 $ next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from /commerce/site/.env.local error - Failed to load next.config.js, see more info here https://nextjs.org/docs/messages/next-config-error Error: Cannot find module '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/dist/config.cjs' at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15) at resolveExports (node:internal/modules/cjs/loader:482:14) at Function.Module._findPath (node:internal/modules/cjs/loader:522:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) at Function.mod._resolveFilename (/Users/dom/work/vercel/commerce/node_modules/next/dist/build/webpack/require-hook.js:179:28) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/Users/dom/work/vercel/commerce/site/commerce-config.js:9:14) { code: 'MODULE_NOT_FOUND', path: '/Users/dom/work/vercel/commerce/node_modules/@vercel/commerce/package.json' } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The error usually occurs when running pnpm dev inside of the /site/ folder after installing a fresh repository.
In order to fix this, run pnpm build in the monorepo root folder first.
Using
pnpm devfrom the root is recommended for developing, which will run watch mode on all packages.