* Moved everything * Figuring out how to make imports work * Updated exports * Added missing exports * Added @vercel/commerce-local to `site` * Updated commerce config * Updated exports and commerce config * Updated commerce hoc * Fixed exports in local * Added publish config * Updated imports in site * It's actually working * Don't use debugger in dev for better speeds * Improved DX when editing packages * Set up eslint with husky * Updated prettier config * Added prettier setup to every package * Moved bigcommerce * Moved Bigcommerce to src and package updates * Updated setup of bigcommerce * Moved definitions script * Moved commercejs * Move to src * Fixed types in commercejs * Moved kibocommerce * Moved kibocommerce to src * Added package/tsconfig to kibocommerce * Fixed imports and other things * Moved ordercloud * Moved ordercloud to src * Fixed imports * Added missing prettier files * Moved Saleor * Moved Saleor to src * Fixed imports * Replaced all imports to @commerce * Added prettierignore/rc to all providers * Moved shopify to src * Build shopify in packages * Moved Spree * Moved spree to src * Updated spree * Moved swell * Moved swell to src * Fixed type imports in swell * Moved Vendure to packages * Moved vendure to src * Fixed imports in vendure * Added codegen to saleor * Updated codegen setup for shopify * Added codegen to vendure * Added codegen to kibocommerce * Added all packages to site's deps * Updated codegen setup in bigcommerce * Minor fixes * Updated providers' names in site * Updated packages based on Bel's changes * Updated turbo to latest * Fixed ts complains * Set npm engine in root * New lockfile install * remove engines * Regen lockfile * Switched from npm to yarn * Updated typesVersions in all packages * Moved dep * Updated SWR to the just released 1.2.0 * Removed "isolatedModules" from packages * Updated list of providers and default * Updated swell declaration * Removed next import from kibocommerce * Added COMMERCE_PROVIDER log * Added another log * Updated turbo config * Updated docs * Removed test logs Co-authored-by: Jared Palmer <jared@jaredpalmer.com>
Next.js Commerce
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
- Shopify Demo: https://shopify.vercel.store/
- Swell Demo: https://swell.vercel.store/
- BigCommerce Demo: https://bigcommerce.vercel.store/
- Vendure Demo: https://vendure.vercel.store
- Saleor Demo: https://saleor.vercel.store/
- Ordercloud Demo: https://ordercloud.vercel.store/
- Spree Demo: https://spree.vercel.store/
- Kibo Commerce Demo: https://kibocommerce.vercel.store/
- Commerce.js Demo: https://commercejs.vercel.store/
Features
- Performant by default
- SEO Ready
- Internationalization
- Responsive
- UI Components
- Theming
- Standardized Data Hooks
- Integrations - Integrate seamlessly with the most common ecommerce platforms.
- Dark Mode Support
Integrations
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.
Considerations
packages/commerce
contains all types, helpers and functions to be used as base to build a new provider.- Providers live under
packages
's root folder and they will extend Next.js Commerce types and functionality (packages/commerce
). - We have a Features API to ensure feature parity between the UI and the Provider. The UI should update accordingly and no extra code should be bundled. All extra configuration for features will live under
features
incommerce.config.json
and if needed it can also be accessed programatically. - Each provider should add its corresponding
next.config.js
andcommerce.config.json
adding specific data related to the provider. For example in case of BigCommerce, the images CDN and additional API routes.
Configuration
How to change providers
Open .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 .env.template
as the base).
The setup for Shopify would look like this for example:
COMMERCE_PROVIDER=shopify
NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxx
NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=xxxxxxx.myshopify.com
Features
Every provider defines the features that it supports under packages/{provider}/src/commerce.config.json
Features Available
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.
- cart
- search
- wishlist
- customerAuth
- customCheckout
How to turn Features on and off
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)
- Open
commerce.config.json
- You'll see a config file like this:
{ "features": { "wishlist": false, "customCheckout": true } }
- Turn
wishlist
on by settingwishlist
totrue
. - Run the app and the wishlist functionality should be back on.
How to create a new provider
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.
Contribute
Our commitment to Open Source can be found here.
- Fork this repository to your own GitHub account and then clone it to your local device.
- Create a new branch
git checkout -b MY_BRANCH_NAME
- Install the dependencies:
npm i
- Duplicate
.env.template
and rename it to.env.local
- Add proper store values to
.env.local
- Run
npm run dev
to build and watch for code changes
Work in progress
We'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.
Troubleshoot
I already own a BigCommerce store. What should I do?
First thing you do is: set your environment variables
.env.local
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.
- Install Vercel CLI:
npm i -g vercel
- Link local instance with Vercel and Github accounts (creates .vercel file):
vercel link
- Download your environment variables:
vercel env pull .env.local
Next, you're free to customize the starter. More updates coming soon. Stay tuned..
BigCommerce shows a Coming Soon page and requests a Preview Code
After Email confirmation, Checkout should be manually enabled through BigCommerce platform. Look for "Review & test your store" section through BigCommerce's dashboard.
BigCommerce team has been notified and they plan to add more details about this subject.