mirror of
https://github.com/vercel/commerce.git
synced 2025-06-19 05:31:22 +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
|
# Available providers: bigcommerce, shopify
|
||||||
# To test a different provider, comment or remove the variables of other providers first
|
COMMERCE_PROVIDER=bigcommerce
|
||||||
|
|
||||||
BIGCOMMERCE_STOREFRONT_API_URL=
|
BIGCOMMERCE_STOREFRONT_API_URL=
|
||||||
BIGCOMMERCE_STOREFRONT_API_TOKEN=
|
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
|
### 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).
|
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).
|
||||||
|
|
||||||
Comment or remove environment variables of other providers to avoid conflicts.
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
@ -10,11 +10,14 @@ const prettier = require('prettier')
|
|||||||
const PROVIDERS = ['bigcommerce', 'shopify']
|
const PROVIDERS = ['bigcommerce', 'shopify']
|
||||||
|
|
||||||
function getProviderName() {
|
function getProviderName() {
|
||||||
return process.env.BIGCOMMERCE_STOREFRONT_API_URL
|
return (
|
||||||
|
process.env.COMMERCE_PROVIDER ||
|
||||||
|
(process.env.BIGCOMMERCE_STOREFRONT_API_URL
|
||||||
? 'bigcommerce'
|
? 'bigcommerce'
|
||||||
: process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
|
: process.env.NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN
|
||||||
? 'shopify'
|
? 'shopify'
|
||||||
: null
|
: null)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function withCommerceConfig(nextConfig = {}) {
|
function withCommerceConfig(nextConfig = {}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user