Skip to content

Commit

Permalink
update commerce guide
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffpatzer committed Apr 15, 2022
1 parent c56c517 commit ae8f394
Showing 1 changed file with 39 additions and 31 deletions.
70 changes: 39 additions & 31 deletions guides/next_commerce.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,51 +34,59 @@ If you wish to deploy to {{ PRODUCT_NAME }} from the official Next.js Commerce r

1. Clone the official Next.js Commerce repository and install the dependencies.

```bash
git clone git@github.com:vercel/commerce.git
cd commerce
yarn
cd site
```
```bash
git clone git@github.com:vercel/commerce.git
cd commerce
yarn
```

2. Run {{ PRODUCT_NAME }} `init` in the project directory:

```
{{ CLI_NAME }} init
```
```
cd site
{{ CLI_NAME }} init
```

3. Duplicate `.env.template` and name it `.env.local` in the project directory. Add your BigCommerce API keys to it.

```
COMMERCE_PROVIDER=@vercel/commerce-bigcommerce
BIGCOMMERCE_STOREFRONT_API_URL=https://store-${STORE_HASH}-${CHANNEL_ID}.mybigcommerce.com/graphql
BIGCOMMERCE_STOREFRONT_API_TOKEN=${STOREFRONT_API_TOKEN}
BIGCOMMERCE_STORE_API_URL=https://api.bigcommerce.com/stores/${STORE_HASH}
BIGCOMMERCE_STORE_API_TOKEN=${STORE_TOKEN}
BIGCOMMERCE_STORE_API_CLIENT_ID=${STORE_CLIENT}
BIGCOMMERCE_CHANNEL_ID=${CHANNEL_ID}
BIGCOMMERCE_STORE_URL=https://store-${STORE_HASH}.mybigcommerce.com
BIGCOMMERCE_STORE_API_STORE_HASH=${STORE_HASH}
```
For more details on how to set up your BigCommerce store, view the [BigCommerce guide](/guides/bigcommerce).

```
COMMERCE_PROVIDER=@vercel/commerce-bigcommerce
BIGCOMMERCE_STOREFRONT_API_URL=https://store-${STORE_HASH}-${CHANNEL_ID}.mybigcommerce.com/graphql
BIGCOMMERCE_STOREFRONT_API_TOKEN=${STOREFRONT_API_TOKEN}
BIGCOMMERCE_STORE_API_URL=https://api.bigcommerce.com/stores/${STORE_HASH}
BIGCOMMERCE_STORE_API_TOKEN=${STORE_TOKEN}
BIGCOMMERCE_STORE_API_CLIENT_ID=${STORE_CLIENT}
BIGCOMMERCE_CHANNEL_ID=${CHANNEL_ID}
BIGCOMMERCE_STORE_URL=https://store-${STORE_HASH}.mybigcommerce.com
BIGCOMMERCE_STORE_API_STORE_HASH=${STORE_HASH}
```

- `STORE_HASH`: You can retrieve it from your BigCommerce store control panel URL in the format of `https://store-${STORE_HASH}.mybigcommerce.com/manage/dashboard`
- `STORE_TOKEN|STORE_CLIENT`: For instructions on generating Store API credentials, visit [Obtaining Store API Credentials](https://developer.bigcommerce.com/api-docs/getting-started/authentication/rest-api-authentication#obtaining-store-api-credentials)
- `STOREFRONT_API_TOKEN`: For instructions on generating the Storefront API token, visit [Create a Token](https://developer.bigcommerce.com/api-reference/store-management/tokens/api-token/createtoken).
- `CHANNEL_ID`: Visit [Building Channels](https://developer.bigcommerce.com/docs/ZG9jOjE5NjMyODU-building-channels-quick-start) to learn how to create a channel for use in your application.

- `STORE_HASH`: You can retrieve it from your BigCommerce store control panel URL in the format of `https://store-${STORE_HASH}.mybigcommerce.com/manage/dashboard`
- `STORE_TOKEN|STORE_CLIENT`: For instructions on generating Store API credentials, visit [Obtaining Store API Credentials](https://developer.bigcommerce.com/api-docs/getting-started/authentication/rest-api-authentication#obtaining-store-api-credentials)
- `STOREFRONT_API_TOKEN`: For instructions on generating the Storefront API token, visit [Create a Token](https://developer.bigcommerce.com/api-reference/store-management/tokens/api-token/createtoken).
- `CHANNEL_ID`: Visit [Building Channels](https://developer.bigcommerce.com/docs/ZG9jOjE5NjMyODU-building-channels-quick-start) to learn how to create a channel for use in your application.
4. Deploy to {{ PRODUCT_NAME }}.

For more details on how to set up your BigCommerce store, view the [BigCommerce guide](/guides/bigcommerce).
From project root

4. Deploy to {{ PRODUCT_NAME }}.
```bash
npm run deploy
```

From inside the `commerce/site` directory.
Or from within `site` directory

```bash
{{ CLI_NAME }} deploy
```
```bash
{{ CLI_NAME }} deploy
```

## Learn more

For more details on using Next.js on {{ PRODUCT_NAME }} refer to the [Next.js Guide](next).
For more details on using Next.js on {{ PRODUCT_NAME }} refer to the [Next.js guide](next).

For more details on how to set up your BigCommerce store, view the [BigCommerce guide](/guides/bigcommerce).

## Connector

Expand Down

0 comments on commit ae8f394

Please sign in to comment.