Skip to content

Commit e6c0f3e

Browse files
@W-19151918: 🚀 Shopper Agent Experience v3.0 ( GA ) (#3259)
* fix: add refresh token to shopper agent @W-19097065 (#2999) * fix: pass refresh token to shopper agent * fix: add jsdocs for refresh token * fix: add jsdocs for refresh token * fix: refresh-token-enhancements (#3030) * fix: passing currency based off the locale to miaw session (#3131) * fix: disable input when agent is processing the request (#3242) * fix: conversational context (#3258) * fix: rename miaw event * fix: check for conversational context * fix: localization support - sf support languages (#3275) * fix: localization support - sf support languages (#3284) --------- Co-authored-by: sf-jhalak-maheshwari <jmaheshwari@salesforce.com>
1 parent 011cc3e commit e6c0f3e

File tree

15 files changed

+1546
-490
lines changed

15 files changed

+1546
-490
lines changed

packages/pwa-kit-create-app/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
## v3.13.0-dev (Sep 04, 2025)
1+
## v3.13.0-dev (Sep 17, 2025)
2+
- This features introduces enhancements to the shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications, adding comprehensive context support, localization capabilities, and improved user experience features. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
23

34
## v3.12.0 (Sep 04, 2025)
45
- This feature introduces an AI-powered shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications. The shopper agent provides real-time chat support, search assistance, and personalized shopping guidance directly within the e-commerce experience. [#2658](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2658)

packages/pwa-kit-create-app/assets/bootstrap/js/config/default.js.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ module.exports = {
3232
scrt2Url: '',
3333
salesforceOrgId: '',
3434
commerceOrgId: '',
35-
siteId: ''
35+
siteId: '',
36+
enableConversationContext: 'false',
37+
conversationContext: []
3638
},
3739
// Customize how your 'site' and 'locale' are displayed in the url.
3840
url: {

packages/pwa-kit-create-app/assets/templates/@salesforce/retail-react-app/config/default.js.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ module.exports = {
3232
scrt2Url: '',
3333
salesforceOrgId: '',
3434
commerceOrgId: '',
35-
siteId: ''
35+
siteId: '',
36+
enableConversationContext: 'false',
37+
conversationContext: []
3638
},
3739
// Customize settings for your url
3840
url: {

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
- Updated search UX - prices, images, suggestions new layout [#3271](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3271)
33
- Updated the UI for StoreDisplay component which displays pickup in-store information on different pages. [#3248](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3248)
44
- Added warning modal for guest users when toggling between multi ship and ship to one address. [3280] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3280) [3302] (https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3302)
5+
- Enhanced the shopping assistant that integrates Salesforce Embedded Messaging Service with PWA Kit applications, adding comprehensive context support, localization capabilities, and improved user experience features. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
6+
- [Breaking] Removed domainUrl, locale, basetId properties as part off the ShopperAgent during initialization. [#3259](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/3259)
57

68
## v8.0.0 (Sep 04, 2025)
79
- Add support for environment level base paths on /mobify routes [#2892](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2892)

packages/template-retail-react-app/app/components/_app/index.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,6 @@ const App = (props) => {
366366
{commerceAgentConfiguration?.enabled === 'true' && (
367367
<ShopperAgent
368368
commerceAgentConfiguration={commerceAgentConfiguration}
369-
domainUrl={`${appOrigin}${buildUrl(location.pathname)}`}
370-
locale={locale?.id}
371-
basketId={basket?.basketId}
372369
basketDoneLoading={basketQueryLastUpdateTime > 0}
373370
/>
374371
)}

packages/template-retail-react-app/app/components/search/index.jsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ const Search = (props) => {
188188
if (!miawChatRef.current.hasFired && miawChatRef.current.newChatLaunched) {
189189
if (
190190
e.detail.conversationEntry?.sender?.role === 'Chatbot' &&
191-
searchInputRef?.current?.value
191+
searchInputRef?.current?.value &&
192+
window.embeddedservice_bootstrap?.utilAPI
192193
) {
193194
miawChatRef.current.hasFired = true
194195
setTimeout(() => {
@@ -208,17 +209,21 @@ const Search = (props) => {
208209
}
209210
}, [])
210211
const launchChat = () => {
211-
window.embeddedservice_bootstrap.utilAPI
212-
.launchChat()
213-
.then((successMessage) => {
212+
if (window.embeddedservice_bootstrap?.settings) {
213+
window.embeddedservice_bootstrap.settings.disableStreamingResponses = true
214+
window.embeddedservice_bootstrap.settings.enableUserInputForConversationWithBot = false
215+
}
216+
window.embeddedservice_bootstrap?.utilAPI
217+
?.launchChat()
218+
?.then((successMessage) => {
214219
/* TODO: With the Salesforce Winter '26 release, we will be able to use the
215220
* onEmbeddedMessagingFirstBotMessageSent event instead, and get rid of this logic. */
216221
if (successMessage.includes('Successfully initialized the messaging client')) {
217222
miawChatRef.current.hasFired = false //We want the logic in onEmbeddedMessageSent to happen once per new conversation
218223
miawChatRef.current.newChatLaunched = true
219224
}
220225
})
221-
.catch((err) => {
226+
?.catch((err) => {
222227
console.error('launchChat error', err)
223228
})
224229
}
@@ -232,7 +237,7 @@ const Search = (props) => {
232237
return
233238
}
234239

235-
if (askAgentOnSearchEnabled && window.embeddedservice_bootstrap) {
240+
if (askAgentOnSearchEnabled && window.embeddedservice_bootstrap?.utilAPI) {
236241
// Add a 500ms delay before sending the message to ensure the experience isn't jarring to the user
237242
setTimeout(() => {
238243
window.embeddedservice_bootstrap.utilAPI

0 commit comments

Comments
 (0)