To redeploy a storefront that was created in Business Manager after initial deployment, use the Storefront Next CLI and the autocreated MRT project and environment.
Prerequisites
- Node Package Manager (pnpm) version 10.28.0 or later. See Installation on the pnpm site.
- Node.js version 24.13.0 or later. See Download Node.js on the Node.js site.
- To install Storefront Next dependencies specified in
package.json, run thepnpm installcommand. - To save the MRT API key credentials using the B2C CLI, install the B2C CLI. See Agentic B2C Developer Toolkit.
Steps
-
In Business Manager, navigate to your storefront. Click App Launcher
, then select Administration > Sites > Storefronts, and click your storefront. -
In the storefront detail page, click your environment, and then next to Deployments, click Manage.
-
If you have an
.envfile in your storefront with the project ID (MRT_PROJECT) and environment ID (MRT_TARGET), skip this step. Otherwise, get these values from Runtime Admin.a. To get the environment ID, click Environment Settings, and copy the Environment ID value.
b. To get the project ID, click the project name, then Project Settings, and copy the Project ID value.
-
To authenticate the CLI to Managed Runtime, use an API key. Get the Managed Runtime API key in Managed Runtime Admin. In Account Settings, under Personal API Key:
a. If you haven't yet created an API key, click Generate.
b. If you already have an API key, the value is partially masked. Click Reset, then click Reset my API Key when asked for confirmation.
c. Run this command to save the API key locally in the
~/.mobifyfile so it can be reused whenever you run thepnpm sfnext pushcommand. Replace the placeholder values in this command before running it.b2c mrt save-credentials --user {your-email@example.com} --api-key {your-mrt-api-key}note: We recommend saving the MRT API key credentials. If you don't save the MRT API key, you can add the API key in the
MRT_API_KEYvariable in the.envfile or supply it in the--api-keyargument on the command line. See MRT API Key in the Agentic B2C Developer Toolkit. -
From your local storefront folder, use this command to create a bundle and deploy it to your Managed Runtime environment. Replace the placeholders with the MRT project ID, target environment, and the API key you got earlier.
pnpm sfnext push --project {mrt-project-id} --environment {target-env} --message "Deploying quick start bundle."tip: Always run
pnpm sfnext pushfrom the local storefront folder. To run the push command from another folder outside your storefront, usepnpm dlx @salesforce/storefront-next-dev pushinstead and pass in the storefront folder path with--project-directory {sfnext-project-folder}.note: The
.envfile in your Storefront Next project folder contains environment variables that the Storefront Next CLI uses. You can set the project ID in theMRT_PROJECTvariable and the target environment in theMRT_TARGETvariable. If you specify these values in both the command line and the.envfile, the command line arguments are used. -
Verify that the bundle was deployed to the target environment. In Managed Runtime Admin, in Projects, click your project and then your environment.
Deploy Bundles in Business Manager (Beta)
If your B2C org is enrolled in the Developer Workspace beta, deploy new bundles from Business Manager and track the deployment progress and history. Before deploying a bundle, create it by following the steps in this page. Omit the --environment argument to skip bundle deployment and only upload it. Also, make sure tho remove the MRT_TARGET variables from the .env file.
To upload a bundle, use either of these commands. Find the project ID in the downloaded .env file from the storefront detail page in Business Manager, or in the Complete Your Storefront task.
pnpm sfnext push --project {mrt-project-id} --message "Deploying quick start bundle."
Alternatively, use the B2C CLI to upload a bundle. With the B2C CLI commands, you can choose SCAPI and use SCAPI authentication with the --mrt-backend argument. For more information about setting up the B2C CLI, see Automate Storefront Administration Tasks with the B2C CLI.
npx @salesforce/b2c-cli mrt bundle upload-v2 -p {mrt-project-id} --message "Deploying quick start bundle."
Next, deploy the bundle to an environment in Business Manager in Administration > Storefronts > Your Storefront > Bundles.

Create and Deploy Bundles via the B2C CLI
Use the mrt bundle commands to create and deploy bundles to an environment. See Automate Storefront Administration Tasks with the B2C CLI.