You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,85 @@ Feel free to share this survey link with your colleagues, partners, or anyone wh
8
8
9
9
Thank you for being a part of our community and for your continuous support! :raised_hands:
10
10
11
+
## :warning: Planned API Changes :warning:
12
+
13
+
### Shopper Context
14
+
15
+
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](https://developer.salesforce.com/docs/commerce/commerce-api/references/shopper-context?meta=Summary) in the notes section.
16
+
17
+
### Shopper Login (SLAS)
18
+
19
+
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](https://developer.salesforce.com/docs/commerce/commerce-api/guide/slas.html#guest-tokens).
20
+
21
+
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.
22
+
23
+
### Summary of Changes for PWA Kit v2
24
+
25
+
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.
26
+
27
+
#### 1. Update `auth.js` to Include `channel_id` in Calls to Shopper Login
28
+
29
+
Add the `channel_id` parameter in the appropriate functions for obtaining tokens.
30
+
31
+
##### Example Changes:
32
+
```diff
33
+
// In the Auth class, add channel_id to the data in _loginAsGuest method
34
+
channel_id: this._config.parameters.siteId
35
+
36
+
// In the refreshToken method, add channel_id to the data
#### 2. Scope Local Storage Keys and Cookie Names per Site for Multisite Projects
41
+
42
+
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.
43
+
44
+
##### Example Changes:
45
+
```diff
46
+
// Add siteId parameter in LocalStorage and CookieStorage constructors
47
+
constructor(siteId, ...args) {
48
+
super(args)
49
+
if (typeof window === 'undefined') {
50
+
throw new Error('LocalStorage is not available in the current environment.')
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.
84
+
85
+
#### Recommendation:
86
+
87
+
- Established sites that do not need this change should avoid implementing it to prevent logging out existing users.
88
+
- 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.
0 commit comments