This gist includes sample code which supports hybrid deployment in PWA Kit retail react app. This code mainly demonstrates updating routes in a PWA Kit project generated using version 3.0.0 later with extensibility disabled.
This gist includes sample code which supports hybrid deployment in PWA Kit retail react app. The major changes are in auth.js where the authentication module supports storing auth tokens as cookies and login(..) function calls the /sessions OCAPI endpoint to bridge sessions between PWA Kit and SFRA sites.
If you generated a PWA Kit project prior to v2.7.1, you need to adopt the changes from this file in your project.
Code diffs are available in the PR: https://github.com/SalesforceCommerceCloud/pwa-kit/pull/1159/files
You can implement merge baskets using existing Script API. A recommended approach is to append to existing SFRA/SG controllers where a shopper can log in and implement functionality to then merge baskets as shown in the scripts below.
In a custom SFRA/SG cartridge, extend the Login functionality using server.extend() and server.append() functions like so:
*/cartridges/controllers/Account.js
This document provides a comprehensive suite of matrix configurations for a hybrid architecture combining Storefront Next (Modern React Router 7 Stack) and SFRA / SiteGenesis (Legacy Salesforce Commerce Cloud).
HYBRID_ROUTING_RULES: An optimized, single-expression Cloudflare pattern utilized by the Edge, Vite Proxy, and MRT Runtime. It natively handles optional/:siteId/:localeprefixes using^(/[^/]+/[^/]+)?.PUBLIC__app__hybrid__legacyRoutes: A JSON array used by the React client-side routing middleware to trigger an ejection when a shopper navigates via SPA links.