mirror of
https://github.com/vercel/commerce.git
synced 2025-06-18 21:21:21 +00:00
Added new commerce variable
This commit is contained in:
parent
bfae57653f
commit
a7d368a1f5
@ -1,5 +1,5 @@
|
||||
# Only include the environment variables for a single provider
|
||||
# To test a different provider, comment or remove the variables of other providers first
|
||||
# Available providers: bigcommerce, shopify
|
||||
COMMERCE_PROVIDER=bigcommerce
|
||||
|
||||
BIGCOMMERCE_STOREFRONT_API_URL=
|
||||
BIGCOMMERCE_STOREFRONT_API_TOKEN=
|
||||
|
@ -71,9 +71,7 @@ Next.js Commerce provides a set of utilities and functions to create new provide
|
||||
|
||||
### How to change providers
|
||||
|
||||
Open `.env.local` and set the environment variables for the provider you would like to use (use `.env.template` as the base).
|
||||
|
||||
Comment or remove environment variables of other providers to avoid conflicts.
|
||||
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).
|
||||
|
||||
### Features
|
||||
|
||||
|
@ -10,11 +10,14 @@ const prettier = require('prettier')
|
||||
const PROVIDERS = ['bigcommerce', 'shopify']
|
||||
|
||||
function getProviderName() {
|
||||
return process.env.BIGCOMMERCE_STOREFRONT_API_URL
|
||||
? 'bigcommerce'
|
||||
: process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
|
||||
? 'shopify'
|
||||
: null
|
||||
return (
|
||||
process.env.COMMERCE_PROVIDER ||
|
||||
(process.env.BIGCOMMERCE_STOREFRONT_API_URL
|
||||
? 'bigcommerce'
|
||||
: process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
|
||||
? 'shopify'
|
||||
: null)
|
||||
)
|
||||
}
|
||||
|
||||
function withCommerceConfig(nextConfig = {}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user