Storefront Next
Develop and operate your Storefront Next storefront with the B2C CLI and your AI assistant. Manage environment variables together, investigate runtime errors, and get help with routing, data fetching, and Page Designer components.
Start with Storefront Setup
Use storefront setup in Business Manager to create your storefront and its API clients, Managed Runtime project, default environment, and initial configuration. Follow the Salesforce guide for your source-code workflow:
Use the generated configuration for local development and the existing MRT resources for the operations below. For additional environments and production launch, follow Launch Your Storefront Next.
Prerequisites
Use an existing Storefront Next project and an MRT API key with access to its project and target environment. See CLI installation and MRT configuration for credentials and defaults. You can also replace b2c in these examples with npx @salesforce/b2c-cli.
Replace my-storefront and staging with your MRT project and environment IDs.
Manage Environment Variables
Storefront setup configures the initial MRT variables. Use the CLI to inspect or change selected values as your storefront evolves. Salesforce's Environment Variables guide covers naming, visibility, and supported configuration paths.
The toolkit can also use common Storefront Next project variables as local CLI, MCP, and IDE configuration. See Storefront Next configuration compatibility for the supported mappings and precedence.
Update Several Values Together
# Inspect the target environment's variables.
b2c mrt env var list --project my-storefront --environment staging
# Set locale defaults together in one update.
b2c mrt env var set \
PUBLIC__app__i18n__fallbackLng=en-US \
'PUBLIC__app__i18n__supportedLngs=["en-US","fr-FR"]' \
--project my-storefront --environment stagingUse locales supported by your storefront and sites. Variable changes redeploy the environment; wait for that deployment before checking the result. Keep secrets out of PUBLIC__ variables, which are exposed to the browser.
Apply an Environment File
Keep the values intended for each MRT environment in a separate file. Review the proposed changes before applying them:
b2c mrt env var push --file .env.staging \
--project my-storefront --environment stagingThe command compares the file with the target, shows the differences, and asks for confirmation. It leaves remote variables absent from the file unchanged and excludes MRT_ variables by default. Review local-only values and instance-specific credentials before sharing configuration across environments; keep files containing secrets out of source control.
See MRT environment variable commands for individual updates, removal, and file options.
Tail Application Logs
Stream logs while reproducing a server-rendering error or checking a deployment:
b2c mrt tail-logs --project my-storefront --environment staging
# Show errors and warnings.
b2c mrt tail-logs --project my-storefront --environment staging \
--level ERROR --level WARN
# Match an error or request pattern.
b2c mrt tail-logs --project my-storefront --environment staging \
--search 'timeout|500'Press Ctrl+C to stop. See Logging in Storefront Next for application logging conventions. For historical investigation across MRT, SLAS, and eCDN, follow Debug Your Storefront Next Site Using Log Center.
Work with Deployments
For source builds and uploads, follow the Storefront Next deployment workflow using the template's push package script (sfnext push). It uses the MRT resources created during setup.
Use the B2C CLI to inspect uploaded bundles or deploy an existing bundle to a selected environment:
b2c mrt bundle list --project my-storefront
# Deploy a reviewed bundle; replace 12345 with its ID.
b2c mrt bundle deploy 12345 --project my-storefront --environment stagingFor release automation, see MRT commands and CI/CD with GitHub Actions. For vanity domains, routing, and access-control headers, use the Storefront Next launch guide alongside the eCDN commands.
Work with Your AI Assistant
The B2C MCP includes Storefront Next skills for routing, data fetching, configuration, Page Designer, testing, and deployment. Your assistant can use that guidance alongside documentation search and the toolkit's operations. No separate skills installation is needed; standalone Agent Skills are also available.
Review my Storefront Next project's configuration and the staging MRT environment. Identify differences relevant to this deployment and explain the proposed changes before applying them.
Add a Page Designer component with an editable heading, image, and link. Follow the patterns in this Storefront Next project and explain how to preview it.
Your assistant can stream live MRT logs through the MCP. MRT environment-variable management uses the B2C CLI, so make it available for those changes.
Next Steps
- Storefront Next documentation - Platform setup and development guides.
- Manage Sites for Storefront Next - Site assignments in Business Manager.
- Deploy the Page Designer cartridge - Publish component metadata to your B2C Commerce instance.
- Operations - Investigate job health and checkout incidents with your assistant.