Repository navigation
PWA Kit 3.22 updates passwordless login, reset password and private-client auth for the new SLAS requirements, ships Retail React App 11 and Commerce SDK React 6 as major releases, and adds email delivery through a new cartridge, the Shopper Agent express-payment framework and OpenTelemetry tracing.
Highlights
- 🔒 SLAS requirement changes —
loginPasswordlessnow needslogin_idandchannel_id, andresetPasswordneedsuser_id. Magic links no longer carry the shopper email, and request logs masktoken,login_idandemail. Projects that override the login, reset password or one-click checkout code must update their calls. (#4075, #4092) - 🔑 SLAS strict client auth — The private client proxy and
loginRegisteredUserB2Csend thex-slas-client-authheader so private clients keep working when strict client auth is on. (#4074) - 📧 Transactional email through a cartridge — The new
app_pwakit_baseB2C cartridge sends passwordless, one-time-code, reset password and guest order access-code emails. Marketing Cloud delivery is removed fromssr.js, and the retail template'sconfig/default.jsnow defaults tomode: 'callback'with passwordless and guest order lookup on. Projects generated withcreate-appkeep passwordless off and guest order lookup disabled, but also use callback mode for reset password. Deploy the cartridge or override these settings before upgrading. (#4012) - 💳 Shopper Agent express payments — A neutral iframe framework with cart and product routes lets merchants bring their own express-payment provider into the Shopper Agent. (#4063)
- 🔍 OpenTelemetry tracing — Distributed tracing turns on with
OTEL_TRACING_ENABLED=trueor MRT'sMRT_DISTRIBUTED_TRACING_ENABLED=true. (#4073) - 🎨 Page Designer content blocks — The retail template supports embedded content blocks, with an Announcement Banner component and a standalone component preview route. (#4042)
- 🔧 Maintenance-mode errors —
pwa-kit-dev pushno longer reports unrelated failures as Managed Runtime maintenance mode. (#4080)
Package Changes
@salesforce/pwa-kit-react-sdk@3.22.0
- [Feature] Enable OpenTelemetry and distributed tracing when either
OTEL_TRACING_ENABLED=trueor MRT'sMRT_DISTRIBUTED_TRACING_ENABLED=trueis set. #4073
@salesforce/pwa-kit-runtime@3.22.0
- The SLAS private client proxy now sends the
x-slas-client-authheader (raw base64 private client credentials) on/oauth2/loginand/oauth2/authorize, so private clients work with SLAS strict client auth./oauth2/authorize(GET) is added to the defaultSLAS_PRIVATE_PROXY_ALLOWLIST, so apps on the default allow-list now send the private client credentials upstream on/oauth2/loginand can reach/oauth2/authorizethrough the proxy.SlasProxyAuthType.SLAS_CLIENT_AUTHis added for custom allow-lists./oauth2/trusted-agent/tokencontinues to use_sfdc_client_auth. #4074 - Request logs now mask the
token,login_id, andemailquery parameter values, matched case-insensitively (for example in passwordless and reset password links) so shopper emails and one-time tokens are not written to logs. #4092
@salesforce/pwa-kit-dev@3.22.0
- Fix
pwa-kit-dev pushmasking unrelated errors (e.g.400/404/500) as Managed Runtime maintenance mode. Because MRT stamps theX-MRT-Read-Onlyheader on every response during a read-only window, the maintenance message now additionally requires an HTTP503status, so non-maintenance failures surface their real cause. #4080
@salesforce/pwa-kit-create-app@3.22.0
- [Breaking change] Generated
config/default.jsnow setsmode: 'callback'for bothpasswordlessandresetPassword(previously'email'), addscallbackURIvalues and aregistrationVerification.callbackURI, and adds an emptynotifyClientId. This mirrorsretail-react-appand routes these emails through thepwakit-notifycartridge. Projects generated with this version must deploy theapp_pwakit_basecartridge and setnotifyClientId, or overrideresetPassword.modeback to'email', otherwise password resets will not work. #4012 - [Breaking change] The generated
ssr.jsno longer includes the Marketing CloudemailLinkfunction or reads theMARKETING_CLOUD_*environment variables. Passwordless login, password reset and registration emails are sent through thepwakit-notifyendpoint of theapp_pwakit_basecartridge, which requiresnotifyClientIdandPWA_KIT_NOTIFY_SLAS_CLIENT_SECRET. #4012 - Keep the generated
ssr.js.hbstemplates in sync withtemplate-retail-react-app: fix GLO endpoints to read the SLAS access token fromreq.headers.authorization(sent by the client viauseAccessToken().getTokenWhenReady()) instead of thecc-at_*cookie, which is never written in standard SLAS setups. Remove the unusedparseCookieValuehelper. Addpwakit-notifytoken acquisition via a dedicated private SLAS client:getNotifyToken()requiresnotifyClientIdincommerceAPI.parametersandPWA_KIT_NOTIFY_SLAS_CLIENT_SECRET; there is no public-client fallback. Do not add thec_pwakit_notifyscope to the shopper client. Seecartridges/app_pwakit_base/README.mdfor the required notify-client setup. #4012 - [Bugfix] Generated extensible projects now include the config-gated routes from
@salesforce/retail-react-appviagetDynamicRoutes. Previously the reset password landing page (on by default) and the passwordless login landing page returned 404, so emailed magic links could not complete. In hybrid projects the SFRA catch-all route still matches last. - [Security] Keep the generated
ssr.js.hbstemplates in sync withtemplate-retail-react-app: passwordless magic links carry only the token, not the shopper email. #4092 - [Feature] Keep the generated
ssr.js.hbstemplates in sync withtemplate-retail-react-appfor Shopper Agent express payments: allow storefront-owned express-payment routes to be embedded in same-origin iframes. #4063 - Keep the generated
ssr.js.hbstemplate in sync withtemplate-retail-react-app: extract the passwordless-login callback handler to a named exported function (passwordlessLoginCallbackHandler), addemail_idclaim cross-validation against the request body to prevent email-relay attacks, and differentiate the notification type betweenpasswordless-registrationandpasswordless-loginbased on the?register=truequery parameter. #4072 - [Security] Keep the generated
ssr.js.hbstemplates in sync withtemplate-retail-react-app: fix the registration-verification callback guard to checkregistrationVerification.callbackURIinstead ofpasswordless.mode(non-extended template variant), and bind theemail_idclaim in the SLAS callback token to the request body to prevent email-relay attacks. #4067 - [Bugfix] Temporarily pin transitive Vitest to 4.1.11 in the create-app package and generated extensible apps to avoid an npm 10 dependency resolver crash while the Vitest browser packages require 4.1.11.
@salesforce/commerce-sdk-react@6.0.0
- [Breaking] Upgrade to
commerce-sdk-isomorphic@5.8.0. Requirelogin_idandchannel_idongetPasswordLessAccessToken/LoginPasswordlessUserand forward them to the helper as camelCaseloginId/channelId(mapped to snake_case on the wire by isomorphic). Also remove the stale@ts-ignoreonresetPassworduser_id(present in SDK types since 5.2.0);user_idandchannel_idcontinue to be sent on password reset. To migrate, pass the shopper'slogin_id(the same value sent toauthorizePasswordless) and the sitechannel_idto everygetPasswordLessAccessToken/useAuthHelper(AuthHelpers.LoginPasswordlessUser)call. #4075 - [Breaking]
resetPassword/ResetPasswordnow requiresuser_idand throws before calling SLAS when it is missing. SLAS checks it against the user the reset token was issued for. To migrate, pass the email the reset was requested for asuser_idwhen callingresetPassword. #4092 - [Feature] When a SLAS private client secret is set directly via
clientSecret(not PWA Kit private client mode),loginRegisteredUserB2Cnow sends thex-slas-client-authheader so the login works with SLAS strict client auth.authorizeIDPdoes not send the header, because it navigates the browser to SLAS and a navigation cannot carry custom headers; strict client auth for IDP login requires the PWA Kit proxy. #4074
@salesforce/retail-react-app@11.0.0
- [Feature] Export
getDynamicRoutes(config)fromapp/routesso projects that extend this template can include the config-gated routes (reset password and passwordless login landing pages, social login redirect, guest order lookup, Shopper Agent express payment). - [Security] Require
login_idandchannel_idon passwordless OTP token exchange (loginPasswordless) from the login page, auth modal, and one-click checkout contact/registration flows, so SLAS can reject mismatched identifiers. Map SLAS 400 missing/mismatched-identifier errors and passwordless rate limits (429) to existing OTP/login UX, and map password/action rate limits (429) to the too-many-password-reset-attempts UX. Depends on@salesforce/commerce-sdk-react@6.0.0(breaking major; pairs withcommerce-sdk-isomorphic@5.8.0). #4075 - [Security] Passwordless magic links no longer carry the shopper email. When the shopper opens the link in the browser that requested it, the login landing page sends the email remembered at request time (stored in
localStoragefor 15 minutes) aslogin_id; in any other browser or device it keeps the token and asks the shopper to confirm their email to finish signing in. Alogin_idquery parameter (for example in a merchant-configuredemailmode link) is still accepted. Token exchange failures on the landing page are now shown instead of leaving the shopper on the sign-in page with no feedback. Upgrade note: if your project overrides the login page, auth modal, or one-click checkout contact/registration components, callrememberPasswordlessLoginId(email)after each successfulauthorizePasswordlesscall so same-browser magic links sign in without the extra step. Both remembered emails are cleared on logout; if you add your own logout action, callclearRememberedAuthEmails()there too. #4092 - [Feature] The reset password landing page prefills the email when the shopper opens the link in the browser that requested it (stored in
localStoragefor 15 minutes, separately from the passwordless email, and cleared after a successful reset). In any other browser the shopper enters it as before. The reset link still carries only the token. #4092 - [Enhancement] Update guest order lookup copy per the UI text review: the request page now reads "Order Lookup" with revised intro text, title-case field labels, and a "Find Order" button; the verify page uses "Enter the verification code that we sent to {email}.". Remove the placeholder "Order Status" footer link, which pointed to the home page. #4090
- [Bugfix] Keep Commerce Client shopper-agent product links on the PWA Kit storefront. The agent backend sends product links as SFRA URLs on the backend origin (e.g.
/en_US/<slug>-<id>.html), which the widget'sonNavigatenever sees, so clicking a product card left for the SFRA PDP. The storefront now reads the product id from those links in the widget's product slots (cards, product detail title, comparison columns), rewrites theirhrefto the PWA product page, and routes plain clicks through the router. Links in agent message text are left alone. When the product id is not certain from the URL (the last path segment contains-, so it may be a name slug and id, or an id that contains-), it is resolved through Shopper SEOgetUrlMapping; if that finds no product the link keeps its backend URL rather than pointing at a storefront 404. #4076 - [Enhancement] Increase the
main.jsbundle-size budget from 109 kB to 111 kB for the Shopper Agent express-payment iframe framework, and thevendor.jsbudget from 403 kB to 412 kB for the embedded Page Designer content blocks. #4063, #4042 - [Feature] Add a neutral Shopper Agent express-payment iframe framework with cart and product routes, a merchant provider lifecycle contract, validated iframe-to-host events, and automatic iframe sizing. #4063
- [Changed] Rename
pwakit-notifynotification types to flow-based names:passwordless-magic-link→passwordless-login,otp→password-registration. Adds newpasswordless-registrationtype for new-user magic-link delivery — intentionally skips the anti-enumeration account-existence check (correct for the new-user registration flow). - [Security] Cross-validate
email_idfrom the SLAS callback JWT against the request body in the passwordless-login callback, preventing email relay via an arbitrary-recipient registration email whenregister=true. - [Security] Cross-validate
email_idandtokenclaims in the SLAS callback JWT against the request body in the registration-verification callback (/registration-verification-callback), preventing email-relay attacks where a caller with a valid tenant-signed guest token could trigger OTP delivery to an arbitrary address. #4067 - [Bugfix] Gate the GLO magic-link auto-submit on
emailFromContext(email present in router state) rather than the derivedemailvariable, so arriving directly via magic link no longer attempts an auto-submit before the user enters their email address. #4067 - [Enhancement] Update inline agent widget UMD bundle: add follow-up suggestion pills from agent responses, and send
commerce_agent_contextas a TextValue JSON string. Bump the embedded agentcapabilitiesVersionto66(newDEFAULT_EMBEDDED_AGENT_CAPABILITIES_VERSIONconstant, separate from the Commerce Client's65) for context-variable support. Built from inline-agent-widget#17 and inline-agent-widget#18. #4061 - [Bugfix] Temporarily pin transitive Vitest to 4.1.11 to avoid an npm 10 dependency resolver crash during fresh installs while the Vitest browser packages require 4.1.11. #4064
- [Bugfix] Fix
useScriptremount when the script tag is already in the DOM. ShopperAgent (and other consumers) stayed atloaded: falseafter a remount because the existing tag never firedloadagain, so the Commerce Client widget did not re-inject. The hook now stampsdata-script-statuson load/error and only reportsloaded: truewhen that status isready; an in-flight tag stays unloaded until it finishes. #4062 - [Bugfix] Route Commerce Client widget product/checkout/markdown clicks through the storefront
useNavigationrouter via the widget'sonNavigatecallback, so same-tab same-origin links stay in the SPA instead of triggering a full page load. Requires Commerce Client widget1.48.0+.cc_openLinksInNewTab: "true"is unchanged and still opens a new tab. Also fixesbuildUrl(createUrlTemplate) when site/locale are configured asquery_param: paths that already have a query string or hash now get site/locale merged into the existing query instead of a second?appended (which previously corrupted params likeq/pidand swallowed the hash). #4035 - [Enhancement] Update inline agent widget UMD bundle: replace the text-prefix product-context hack with the proper SCRT2 v2 session-context API. Product context is now sent as a
commerce_agent_contextStructuredValue in the SessionContextSet envelope, leaving the shopper's message text unchanged. DefaultcapabilitiesVersionbumped to"65". Built from inline-agent-widget#3. #4054 - [Feature] Add
app_pwakit_baseB2C cartridge for transactional email delivery via ISML templates anddw/net/Mail. GLO access-code emails use thesfcc.app.order.sendOrderAccessCodehook; passwordless login, OTP verification, and password reset use thepwakit-notifyCustom REST API (POST .../organizations/{orgId}/notify?siteId={siteId}, guarded by thec_pwakit_notifySLAS scope). Deploy withnpm run deploy:cartridgefrompackages/template-retail-react-app(usesb2c-cliwith--reloadto upload the cartridge and re-register the SCAPI endpoint in one step), then importOrganizationPreferences.xmlto enable thepwakitNotifyEnabledandpwakitStorefrontHostsite preferences. Required: create a dedicated private SLAS client (notifyClientId) scoped only toc_pwakit_notify, setPWA_KIT_NOTIFY_SLAS_CLIENT_SECRETto its secret, and addnotifyClientIdtocommerceAPI.parametersin your config. Do not addc_pwakit_notifyto the shopper/public client — doing so makes browser-minted guest tokens capable of calling the notification API directly, reopening the email-relay risk this design is intended to close. Seecartridges/app_pwakit_base/README.mdfor full setup steps. #4012 - [Breaking change]
config/default.jsnow setsmode: 'callback'for bothpasswordlessandresetPasswordflows (previously'email'). This routes password-reset confirmation through the SSR/reset-password-callbackroute and the newpwakit-notifycartridge. Projects that adopt this config without deploying the cartridge will have broken password resets — there is noresetPassword.enabledguard (unlikepasswordless.enabled). Either deploy the cartridge before adopting the config change, or explicitly overrideresetPassword.modeback to'email'. #4012 - [Breaking change] Marketing Cloud email delivery is removed from
app/ssr.js. TheemailLinkfunction and theMARKETING_CLOUD_CLIENT_ID,MARKETING_CLOUD_CLIENT_SECRET,MARKETING_CLOUD_SUBDOMAIN,MARKETING_CLOUD_PASSWORDLESS_LOGIN_TEMPLATEandMARKETING_CLOUD_RESET_PASSWORD_TEMPLATEenvironment variables are no longer read. Passwordless login, password reset and registration emails are now sent through thepwakit-notifyendpoint of theapp_pwakit_basecartridge. Projects that send these emails through Marketing Cloud must deploy the cartridge and configurenotifyClientIdandPWA_KIT_NOTIFY_SLAS_CLIENT_SECRET, or keep their own copy of the previousemailLinkimplementation in an overriddenssr.js. #4012 - [Breaking change]
config/default.jsnow setspasswordless.enabledtotrue(previouslyfalse); projects generated withcreate-appuse a bootstrap config that keeps itfalse. Combined withmode: 'callback', projects that inherit this config need theapp_pwakit_basecartridge deployed or must setpasswordless.enabledback tofalse. #4012 - [Breaking change]
config/default.jsnow setsguestOrderLookup.enabledtotrue(previouslyfalse); projects generated withcreate-appuse a bootstrap config that does not enable it. This enables the/order-lookuproutes and the order access code email, which is sent by the cartridge'ssendOrderAccessCodehook. Deploy theapp_pwakit_basecartridge or setguestOrderLookup.enabledback tofalse. #4012 - [Breaking change] Projects that override passwordless or reset password code must update their calls:
loginPasswordlessnow needslogin_id(the email sent toauthorizePasswordless) andchannel_id(the site id), andresetPasswordnow needsuser_id(the email the reset was requested for). See the@salesforce/commerce-sdk-react6.0.0 changelog. #4075, #4092 - [Bugfix] Fix GLO
/api/guestOrderLookup/verifyand related server endpoints returning 401 whenenablePWAKitPrivateClientis enabled. Thecc-nx-g_cookie stores the SLAS refresh token, not the access token — the access token is never stored in any cookie. All GLO server endpoints now read the SLAS JWT from theAuthorizationheader sent by the client (viauseAccessToken().getTokenWhenReady()), which works correctly in both public and private client modes. #4012 - [Enhancement] End the Commerce Client shopper-agent conversation when a registered shopper logs out, instead of re-linking it to the guest. Uses the widget's
eventHandlers.session.endConversation()(cc_cdnVersion>=1.39.0), falls back toresetConversation()on1.36.0–1.38.x, and to re-linking before1.36.0. Also keeps the widget mounted through the login/logout basket reload so the bundle is not injected twice. #4051 - [Enhancement] Commerce Client shopper identity linking now retrieves the auth link key via the widget's
window.CimulateMessaging.getAuthLinkKey()when the bundle exposes it, instead of calling SCRT2's/iamessage/api/v2/authorization/authlinkendpoint directly with the Commerce Client JWT. Older bundles without the function fall back to the direct SCRT2 call (feature-detected, not version-checked). AgetAuthLinkKey()rejection is surfaced as a linking failure rather than retried via the fallback, since both paths hit the same endpoint. #4050 - [Feature] Add embedded Page Designer content-block support to the retail template, including an Announcement Banner content component, a preview-only Header layout, and a chrome-free
/preview/componentroute for standalone component previews. #4042 - [Feature] Add opener question pills to the inline agent widget on the PDP. The Product Detail page parses SCAPI
c_pdpQuestions(a JSON-encoded array of strings published by Commerce Content Studio) and forwards it to the widget via the newpdp-questionsattribute. The widget renders up to 5 tappable pills above the input; tapping a pill sends it through the same message path as typed input, and pills auto-hide once the shopper engages. On SPA navigation between PDPs the pills re-appear for the new product's list. Malformed or absentc_pdpQuestionsrenders no pills.
Full Changelog: v3.21.0...v3.22.0