๐ข Hey there, Salesforce Commerce Cloud community!
Weโre excited to hear your thoughts on your developer experience with PWA Kit and the Composable Storefront generally! Your feedback is incredibly valuable in helping us guide our roadmap and improve our offering.
๐ Take our quick survey here: Survey
Feel free to share this survey link with your colleagues, partners, or anyone who has experience with PWA Kit. Your input will help us shape the future of our development tools.
Thank you for being a part of our community and for your continuous support! ๐
Starting July 31st 2024, all endpoints in the Shopper context API will require the siteId parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025. You can read more about the planned change here in the notes section.
SLAS will soon require new tenants to pass channel_id as an argument for retrieving guest access tokens. You can read more about the planned change here.
Please be aware that existing tenants are on a temporary allow list and will see no immediate disruption to service. We do ask that all users seek to adhere to the channel_id requirement before the end of August to enhance your security posture before the holiday peak season.
To comply with the planned API changes effective July 31st, 2024, you need to update your PWA Kit v2 projects. These changes involve adding the channel_id parameter for Shopper Login and optionally scoping your local storage keys and cookie names with the siteId prefix if your site uses multisite.
Add the channel_id parameter in the appropriate functions for obtaining tokens.
// In the Auth class, add channel_id to the data in _loginAsGuest method
channel_id: this._config.parameters.siteId
// In the refreshToken method, add channel_id to the data
data.append('channel_id', this._config.parameters.siteId)For customers using multiple site IDs, it is recommended to scope your local storage keys and cookie names per site to avoid conflicts. This ensures that tokens from different sites (e.g., RefArch and RefArchGlobal) are not incorrectly used across sites.
// Add siteId parameter in LocalStorage and CookieStorage constructors
constructor(siteId, ...args) {
super(args)
if (typeof window === 'undefined') {
throw new Error('LocalStorage is not available in the current environment.')
}
this.siteId = siteId
}
// Create storage key with siteId prefix
createStorageKey(key) {
return `${this.siteId}_${key}`
}
// Set item in local storage with siteId prefix
set(key, value) {
window.localStorage.setItem(this.createStorageKey(key), value)
}
// Get item from local storage with siteId prefix
get(key) {
return window.localStorage.getItem(this.createStorageKey(key))
}
// Delete item from local storage with siteId prefix
delete(key) {
window.localStorage.removeItem(this.createStorageKey(key))
}
// Similar changes for CookieStorageFull example of the changes in the auth.js file:
https://github.com/SalesforceCommerceCloud/pwa-kit/compare/949b8b3b7...534dab260
Implementing the siteId prefix for local storage keys and cookie names will effectively log out any existing customer sessions on the site. This includes registered logins and baskets for all users.
- Established sites that do not need this change should avoid implementing it to prevent logging out existing users.
- If a project decides to implement this change, be aware that the PWA will now look for tokens under a different cookie name, causing all existing users to be logged out.
๐ Read Docs |
๐๏ธ View Demo |
๐ Deploy |
โ Contribute
The PWA Kit is a storefront technology for headless commerce using Salesforce Commerce APIs and React. It provides front-end developers with a more flexible and agile approach to build and maintain modern shopping experiences.

- Node 18, 20, 22, or 24
- npm 9 or later
npx pwa-kit-create-appEnter your sandbox configuration.
npm startnpm run push -- -m "Message to help you recognize this bundle"
Important: Access to the Runtime Admin application is required to deploy bundles. To learn more, read our guide to Push and Deploy Bundles.
See the Localization README.md for important setup instructions for localization.
The PWA Kit is licensed under a BSD 3-Clause license. See the license for details.
Your contributions are welcome! Refer to the CONTRIBUTING guide to get started. If you like pwa-kit, consider adding a โญ on the GitHub Repo. It helps other people discover PWA Kit!
The full documentation for PWA Kit and Managed Runtime is hosted on the Salesforce Developers portal.
- Get Started
- Skills for Success
- Set Up API Access
- Configuration Options
- Proxy Requests
- Push and Deploy Bundles
- The Retail React App
- Rendering
- Routing
- Phased Headless Rollouts
- Launch Your Storefront
This repository may contain forward-looking statements that involve risks, uncertainties, and assumptions. For more information, see STATEMENTS