Getting Started
This guide shows how to deploy a Catalyst application to BigCommerce’s Native Hosting infrastructure with the Catalyst CLI. If you’re starting from scratch, follow the New project quick start. If you already have a Catalyst repository, jump to Set up with an existing project. Both paths converge on the shared Manage your deployment steps.
The Catalyst CLI is generally available, but Native Hosting is currently in closed beta. There may be breaking changes to the Native Hosting APIs as we finalize them. To express interest in gaining access, fill out the Native Hosting Closed Beta Interest Form.
For how Native Hosting’s projects and configuration variables work, see the Native Hosting overview. For every command and flag, see the CLI reference.
Prerequisites
- Native Hosting access. The Native Hosting feature flag enables the hosting APIs and lets you create an API account with the right permissions. While Native Hosting is in closed beta, you must be approved to have it turned on.
- Permission to create API accounts. Your store user account needs the high-risk user permissions to create store-level API accounts.
New project quick start (recommended)
Scaffold, deploy, and view a hosted storefront in five steps.
-
Scaffold a project. The CLI walks you through naming the project, authenticating via your browser, and connecting a channel, then writes your storefront variables to
.env.localand your CLI credentials to.bigcommerce/project.json, installs dependencies, and initializes a git repository.To set up Native Hosting at the same time, add the
--hosting commerceflag. When you omit it, scaffolding stays hosting-agnostic and you can opt in later — the firstcatalyst deploywill offer to run setup for you.This scaffolds
@bigcommerce/catalyst-core(no Makeswift) by default. For a Makeswift-connected project, add--gh-ref @bigcommerce/catalyst-makeswift@latest. See Makeswift. -
Run it locally (optional). Start the dev server to check your storefront before deploying.
catalyst deploygenerates the GraphQL types it needs on its own, so this step isn’t required. -
Create your Native Hosting project. Skip this step if you scaffolded with
--hosting commerce— that flag already created or selected a hosting project and linked it, and runningprojects createagain would create a second project and replace the link.Otherwise, run this from your project root. It creates a project in BigCommerce’s hosting infrastructure — not a local file — and links your local repository to it by writing
.bigcommerce/project.json. -
Deploy. The CLI builds your project and deploys the assets to BigCommerce’s hosting infrastructure. On success it prints a View your deployment at: URL — that line is the success signal.
-
View your storefront at the printed deployment URL.
Because you authenticated during step 1, you can skip the Authenticate step. To add runtime secrets, point a channel at the deployment, or attach a custom domain, continue with Manage your deployment.
Set up with an existing project
If you already have a Catalyst project (created via One-Click Catalyst or CLI Installation), add Native Hosting to it.
-
Install the CLI in the directory that contains your Catalyst app (the project root for a standalone project, or
core/in a legacy monorepo-structure project). You don’t need to install the OpenNext Cloudflare adapter yourself: Commerce Hosting setup (step 4) adds it, pinned to the version the CLI supports. -
Authenticate. See Authenticate below.
-
Create or link a project. See Create or link a project below.
-
Deploy. The first time you run
pnpm catalyst deploy(orpnpm catalyst projects link) on a project that isn’t set up yet, the CLI prompts to run Commerce Hosting setup. Accepting it transforms your project automatically so you don’t have to make these changes by hand:- Renames
proxy.tstomiddleware.ts, changesexport const proxytoexport const middleware, and addsruntime: 'experimental-edge'to the exported config. This is required becauseproxy.tsis locked to the Node.js runtime, which the OpenNext Cloudflare adapter doesn’t support. (This workaround will be removed once the adapter supports Node middleware via the Adapters API.) - Adds
@opennextjs/cloudflaretopackage.json, pinned to the version the CLI supports. - Detects the default
instrumentation.ts(which registers@vercel/otel, incompatible with the Cloudflare Workers bundle and the cause of a “Failed to prepare server” error at cold start) and prompts to remove it and drop@vercel/otelfrompackage.json.
The
instrumentation.tsremoval prompt only appears in an interactive terminal. In any non-interactive context (CI, piped input, or a background shell), the cleanup is skipped with a warning — delete or gateinstrumentation.tsyourself, or your deployed worker will keep logging the cold-start error. - Renames
Once setup completes, continue with Manage your deployment.
Manage your deployment
The steps below apply to both paths above once your project is set up.
Authenticate
Commands that interact with the BigCommerce API need your store credentials.
If you scaffolded your project with pnpm create, you’re already authenticated — the CLI stored your credentials in .bigcommerce/project.json during setup, so you can skip this step.
Otherwise — for example, a freshly cloned repository with no stored credentials — authenticate based on your environment:
Local development (interactive): Run pnpm catalyst auth login to authenticate via your browser. The CLI opens the BigCommerce authorization page, walks you through an OAuth device-code flow, and stores 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 reads them 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 Configuration in the Native Hosting overview for the full priority order.
Create or link a project
Run the projects create command from your project root — the directory containing your Catalyst app. This creates a new project in BigCommerce’s hosting infrastructure and links your local repository to it.
If you’ve already created a project, link to it with projects link and the project’s UUID instead.
Creating or linking a project writes .bigcommerce/project.json, which stores your store hash, access token, and project UUID. Because this file includes an access token, don’t commit it to source control.
Runtime environment variables and secrets
In addition to the configuration variables mentioned in the creation step, your deployment needs the runtime variables that Catalyst requires. See the Environment Variables documentation for a full list of required variables. If your store offers wallet payment methods (such as PayPal) on the cart page, also add BIGCOMMERCE_STOREFRONT_UNAUTHENTICATED_TOKEN, which those buttons need. The build doesn’t check for it, so a deploy without it succeeds but the buttons fail.
Save those runtime variables once with catalyst env add. They are stored in .bigcommerce/project.json and sent as encrypted secrets on every deploy from that machine, so you don’t need to pass them again each time. Because .bigcommerce/ isn’t committed to source control, stored values aren’t available in CI; pass them with --secret there instead. See GitHub Actions.
To set or override a variable for a single deployment without storing it, pass it with the --secret flag. A --secret value takes precedence over a stored value for the same key.
catalyst deploy generates your project’s GraphQL types before it builds, so a fresh project doesn’t need a separate pnpm dev or pnpm build first.
After a successful deploy, the CLI prints output similar to the following. The final View your deployment at: line is the success signal — if it’s missing, the deploy failed even when the surrounding build output looks normal.
Point a channel at your deployment
After a successful deploy, point a BigCommerce channel’s site URL at one of your deployment hostnames so the storefront resolves to your new deployment. Run channels update to select a channel and hostname interactively.
To skip the prompts, pass the channel and hostname directly. Run pnpm catalyst projects list to see the available deployment hostnames.
You can also let the deploy do this for you by passing --update-site-url, which prompts to update a channel’s site URL after a successful deploy.
Changing a channel’s site URL removes its custom checkout URL, so checkout falls back to the default channel’s domain. After pointing a channel at a new hostname, set its checkout URL again. See Checkout Domains.
(Optional) Add a custom domain
By default, your deployment is served from a BigCommerce-provided hostname in the form <your-project>.catalyst-sandbox.store (your worker URL), shown in the catalyst deploy output and via pnpm catalyst projects list. To serve it from your own domain, add the domain to your project with catalyst domains add and create the matching DNS record at your DNS provider.
See Custom Domains for the full setup, including DNS records, verification, and managing domains across projects.
(Makeswift projects) Set the production API key
If your project is Makeswift-connected, pointing a channel at your deployment also updates the connected Makeswift site’s base URL, so you don’t need to change it in Makeswift. The CLI doesn’t change MAKESWIFT_SITE_API_KEY, though, so your deployment keeps the key from .env.local, which is usually your development site’s. To set your production site’s key, see Makeswift on Native Hosting.
View logs
Once your storefront is deployed, you can stream live logs or query historical ones. Both commands are scoped to your linked project.
The --format request option renders access-log style output that’s useful for spotting failing routes and status codes, and --format json is handy for piping into other tools. See logs query in the CLI reference for the full set of filters.