Loading
Salesforce Enforces New Security Requirements in Summer 2026Read More
Get Started with B2C Commerce
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Configure MRT and Trusted Domains for the Shopper Agent for Storefront Next

          Configure MRT and Trusted Domains for the Shopper Agent for Storefront Next

          For the Shopper Agent to work with Storefront Next, set up managed runtime (MRT). MRT provides the infrastructure for your Storefront Next storefront, and it enables the Shopper Agent to communicate with the Enhanced Chat service in your Salesforce org. Set the correct environment variables in Managed Runtime for your deployed bundle.

          Required Licenses: See Required Licenses for the B2C Shopper Agent.

          Complete these prerequisites.

          To enable and configure Shopper Agent for Storefront Next, set up a messaging channel and create an embedded service deployment by using the steps in Guided Shopping for B2C Commerce.

          Configure MRT and Trusted Domains for the Shopper Agent

          1. Complete these prerequisites:
            1. Confirm you can access the Managed Runtime Admin console.
            2. Confirm that Enhanced Chat is enabled in your Salesforce org and the channel is connected to your Shopper Agent.
          2. Create a Storefront Next storefront in Business Manager.
          3. To go to the Environment Variables page in Runtime Admin, from the storefront detail page, click the associated MRT environment, and then click Manage next to Environment Variables.
          4. In the Environment Variables page, add the PUBLIC__app__commerceAgent variable.

            For the variable value, enter the JSON-encoded settings that the Shopper Agent Enhanced Chat configuration uses. This example shows the settings. Replace the placeholders for the org name, the storefront site path, and the org ID. Replace the example values with the values for your storefront.

            {
                        "enabled": "true",
                        "embeddedServiceName": "storefront_next_market_street",
                        "embeddedServiceEndpoint": "https://<your-org-name>.test2.my.pc-rnd.site.com/<your-storefront-site-path>",
                        "scriptSourceUrl": "https://<your-org-name>.test2.my.pc-rnd.site.com/<your-storefront-site-path>/assets/js/bootstrap.min.js",
                        "scrt2Url": "https://<your-org-name>.test2.my.pc-rnd.salesforce-scrt.com",
                        "salesforceOrgId": "<your-org-id>",
                        "siteId": "storefrontnext"
                        }

            Find the values for these settings in the chat code snippet of your Enhanced Chat embedded service deployment:

            • salesforceOrgId: First argument to embeddedservice_bootstrap.init().
            • embeddedServiceName: Second argument to embeddedservice_bootstrap.init().
            • embeddedServiceEndpoint: Third argument to embeddedservice_bootstrap.init().
            • scrt2Url: Value of scrt2URL inside the options object (fourth argument to embeddedservice_bootstrap.init()).
            • scriptSourceUrl: The src attribute on the <script> tag at the bottom of the snippet (the bootstrap.min.js URL).
            • siteId: Your B2C Commerce site ID. Not in the snippet; set it to your storefront site ID (for example, "storefrontnext").
            • enabled: Not in the snippet. Set to "true" to activate the Shopper Agent.
          5. Add the storefront and Business Manager domains to the list of Trusted URLs in Salesforce.
            1. In your Salesforce org, at the top of the page, click Setup and select Setup.
            2. In the Quick Find box, enter Trusted URLs and then select Trusted URLs.
            3. Add the storefront and Business Manager domains to the list of Trusted URLs in Salesforce.

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

           
          Loading
          Salesforce Help | Article