You are here:
Agentforce Commerce Client for Messaging
The Agentforce Commerce Client is the storefront application that shoppers use to chat with the Shopper Agent. Install the Commerce Client for your B2C Commerce storefront.
The Commerce Client renders the chat experience on your storefront and connects to your Shopper Agent through the Enhanced Messaging service. When a shopper chats with the Agent, the Commerce Client starts a messaging session on your agent's messaging channel. The Client passes the storefront context, such as the site ID and locale, and streams the agent's responses back to the page.
The Commerce Client chat session closes after two hours of shopper inactivity, per Salesforce platform limits (Service Agent Limits). You can't change the inactivity limit. If a shopper returns after two hours, the chat window shows the welcome message, with no memory of the earlier chat.
Prerequisites
Before you install the Commerce Client, Create a B2C Shopper Agent Using the Automated Setup. Also, record these connection settings for your storefront.
- In your Salesforce org, to locate the required settings, go to Setup
. Go to Embedded Service Deployments, select the
name of your deployment, and in the Code Snippet tile,
click Install Code Snippet. The code snippet includes
these values. <script type='text/javascript'> function initEmbeddedMessaging() { try { embeddedservice_bootstrap.settings.language = 'en_US'; // For example, enter 'en' or 'en-US' embeddedservice_bootstrap.init( '00XXX0000011xsn', 'My_Site', 'https://q3sdb1504032026zs3.test2.my.pc-rnd.site.com/ESWHeadlessNTOSite1780298881333', { scrt2URL: 'https://aafdv12345zs1.test2.my.pc-rnd.salesforce-scrt.com' } );- SCRT2 URL
- Salesforce org ID
- Embedded service developer name
- In B2C Commerce, locate these settings.
- Organization ID. Go to .
- Site ID. Go to . Record the ID value.
Commerce Client Setup for Your Storefront Type
The deployment steps for the Commerce Client depend on your storefront type. For an overview of the Commerce Client and how to customize it, see the Commerce Client guide. The table lists specific storefront instructions.
| Storefront Type | Agentforce Commerce Client Setup Instructions |
|---|---|
| Storefront Reference Architecture (SFRA) | Install the Agentforce Commerce Client on SFRA. Before you deploy the Commerce Client, turn on hybrid authentication. In Business Manager, select . Under Site Settings, enable Hybrid Auth, Shopper Context, Do-Not-Track Synchronization, and HttpOnly True. Also, make sure that you can access the Salesforce Commerce repository on GitHub. |
| PWA Kit | Install the Agentforce Commerce Client on PWA-Kit. |
| Storefront Next | Configure MRT and Trusted Domains for the Shopper Agent for Storefront Next. |
