Install the Agentforce Commerce Client on Storefront Next

For Storefront Next, enable and configure Agentforce Commerce Client through a Managed Runtime environment variable, PUBLIC__app__cimulateAgent. The storefront-next template reads that variable, selects the Commerce Client provider, and injects the widget for you.

Enable the Client 

Set the PUBLIC__app__cimulateAgent environment variable on your Managed Runtime environment.

  1. Log in to the Runtime Admin (https://runtime.commercecloud.com/).
  2. Select your project, then the environment.
  3. Under Environment Variables, add PUBLIC__app__cimulateAgent with a JSON value. Replace these fields with valid values.
1{
2  "enabled": "true",
3  "provider": "commerce-client",
4  "commerceClientScriptSourceUrl": "https://cdn.search.cimulate.ai/copilot-widget/1.9.0/messaging.umd.js",
5  "scrt2Url": "https://your-org.salesforce-scrt.com",
6  "salesforceOrgId": "00Dxx0000000001",
7  "esDeveloperName": "My_Embedded_Service",
8  "headerText": "Commerce Assistant",
9  "disclaimerMarkdown": "This is AI and can make mistakes.",
10  "commerceClientDisplayMode": "panel",
11  "commerceClientPanelWidth": "420px",
12  "commerceClientMode": "messaging",
13  "commerceClientLogoUrl": "https://cimulate.ai/logo.png"
14}

The Shopper Agent is now configured for your Storefront Next storefront.

Deploy 

From the storefront-next template project, push a bundle to Managed Runtime:

1npm run push -- --projectSlug <project-slug>

To push and deploy to a specific target environment, add --target and --wait:

1npm run push -- --projectSlug <project-slug> --target production --wait

Roll Back Commerce Client 

Because the widget is driven entirely by PUBLIC__app__cimulateAgent, disable or revert it without a redeploy by setting "enabled": "false".

Related resources