Guide
Getting started with the CLI
Note
Before you start If you are new to React or Next.js, you may want to start with learn React (opens in a new tab) and learn Next.js (opens in a new tab), then work with the Next.js docs (opens in a new tab).
Prerequisites
- Node.js 20+, using
npm
orpnpm
. - Login access to a BigCommerce store or sandbox. You can create a trial store (opens in a new tab) or spin up a sandbox (opens in a new tab).
- User permissions to create new store-level API accounts (opens in a new tab) on the subject store or help from someone who has permissions.
Create a new Catalyst project
To create a new Catalyst project, use the Catalyst CLI, which will create a new directory that contains your Catalyst project. You don't need to clone the Catalyst GitHub repository (opens in a new tab) monorepo to use the CLI.
When the CLI connects your project to the BigCommerce store you intend to use, you will be asked to sign in to the subject store using the browser and enter a code provided by the CLI. This step registers your Catalyst project and generates the access tokens the storefront needs to use our APIs. For a more in-depth explanation of authentication mechanisms in Catalyst, see Environment variables in the Catalyst docs and Authenticating Customers (opens in a new tab) on the BigCommerce Dev Center.
We recommend creating a new channel for the Catalyst storefront. For more about channel configuration, see BigCommerce's channels docs (opens in a new tab).
To get started with the CLI, run the following command:
or
The CLI will take you through the following prompts:
Run Catalyst
To run your Catalyst storefront locally, cd
into the project directory the CLI created, and run the following command:
Currently, Catalyst supports npm
and pnpm
. It does not currently support yarn
.
The Catalyst storefront will run on http://localhost:3000
.
Configure your Catalyst project
If you want to link your Catalyst project to a different BigCommerce store, repeat the setup process. Run the following command from within the directory that contains your Catalyst project:
If you prefer more control over Catalyst's configuration, you can manually set Catalyst's environment variables. For more information, see Advanced config.