Getting Started
The Catalyst CLI and Native Hosting are currently in closed alpha. There may be breaking changes as we finalize the API. To express interest in gaining access, fill out the Native Hosting Closed Alpha Interest Form.
Below, you’ll find the steps for using the Catalyst CLI to deploy your Catalyst application. Make sure to read the Overview documentation for an overview of BigCommerce’s hosting infrastructure, how configuration variables work, etc.
Prerequisites
- Local Catalyst repository - This can be created either via the One-Click Catalyst app or manually.
- The Native Hosting feature flag enabled - This flag enables the core hosting APIs and allows you to create an API Account with the correct permissions. While Native Hosting is in closed Alpha, you must be approved to have this flag turned on.
- Configuration variables - Refer to the Overview documentation for which variables are needed and where they are read from
- Your store user account must have “high-risk user permissions” to create Store-level API Accounts.
Installation
Install the Catalyst CLI and the OpenNext Cloudflare adapter in the core directory of your Catalyst project.
In the scripts section of your core/package.json file, replace next build with catalyst build in the build script. Then, add a new script for deploying: "deploy": "catalyst deploy". The dev and start scripts remain unchanged and continue to use next dev and next start directly.
The final result will look like this.
For running Catalyst locally, you will still use the same terminal command you used in the past, pnpm dev.
Next.js 16 Migration Note
If your Catalyst project uses Next.js 16, you may have a proxy.ts file in your project root (the default in Next.js 16). Native Hosting on Cloudflare Workers does not currently support Node.js middleware (proxy.ts). You must make the following changes.
- Rename
proxy.tstomiddleware.ts - Change the export from
export const proxytoexport const middleware - Add the edge runtime to your exported config object:
This is required because proxy.ts is locked to the Node.js runtime, which is not supported by the OpenNext Cloudflare adapter. Using middleware.ts with runtime: 'experimental-edge' ensures your middleware runs on Cloudflare Workers. This workaround will be removed once the OpenNext Cloudflare adapter adds support for Node middleware via the Adapters API.
Usage
The Catalyst CLI provides several commands for deploying a Catalyst storefront application to BigCommerce’s infrastructure. See the CLI Reference for a full list of commands and details.
Authenticate
Before running any commands that interact with the BigCommerce API, you need to provide your store credentials. How you do this depends on your environment:
Local development (interactive): Run pnpm catalyst auth login to authenticate via your browser. The CLI will walk you through an OAuth flow and store your credentials locally in .bigcommerce/project.json.
After logging in, you can omit the --store-hash and --access-token flags from all subsequent commands — the CLI will read them from project.json automatically.
CI/CD (non-interactive) — In environments like GitHub Actions where a browser is not available, provide credentials via environment variables (CATALYST_STORE_HASH, CATALYST_ACCESS_TOKEN) or pass them directly as flags (--store-hash and --access-token) on each command. See the Overview documentation for the full configuration priority order.
Create a project
Run the project create command to create a new BigCommerce infrastructure project.
Alternatively, if you’ve already created a project, you can link to an existing one if you know the project’s uuid using the project link command.
After creating a new project or linking to an existing one, a .bigcommerce/project.json file should have been created for you. This file will store the necessary configuration variables such as your store hash, access token, etc. Since this file includes an access token, it should not be checked into source control.
Deploy your Catalyst project
When you’re ready, run the deploy command to build your Catalyst project and deploy those build assets to BigCommerce’s hosting infrastructure.
In addition to the deploy command depending on the configuration variables mentioned in the creation step, you’ll also need to include the runtime variables necessary for Catalyst. See the Environment Variables documentation for a full list of required variables.
You’ll need to pass each of your runtime variables into the deploy command as a secret by using the --secret flag. The --secret flag ensures that each of your variables is encrypted and is not human readable after creation.
For example, to pass the BIGCOMMERCE_STORE_HASH and BIGCOMMERCE_STOREFRONT_TOKEN variables, the command would look like this:
Again, make sure to pass all necessary runtime variables.