@descope/react-sdk 2.30.5 → 2.30.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -543,7 +543,7 @@ const AppRoot = () => {
543
543
 
544
544
  ### Custom Storage
545
545
 
546
- By default the SDK reads and writes to `window.localStorage` for state that needs to outlive a single page load (last-authenticated user, client-side session-refresh optimization markers, etc.). If `localStorage` is unavailable or you want to back these keys with something else — `sessionStorage`, an in-memory store, an encrypted wrapper — pass a `customStorage` prop to the `AuthProvider`.
546
+ By default the SDK reads and writes to `window.localStorage` for state that needs to outlive a single page load (last-authenticated user, tokens when they aren't stored in cookies, etc.). If `localStorage` is unavailable or you want to back these keys with something else — `sessionStorage`, an in-memory store, an encrypted wrapper — pass a `customStorage` prop to the `AuthProvider`.
547
547
 
548
548
  ```js
549
549
  import { AuthProvider } from '@descope/react-sdk';
@@ -578,13 +578,15 @@ type CustomStorage = {
578
578
  };
579
579
  ```
580
580
 
581
- > **Note:** The SDK writes a small set of internal keys (e.g. for the last-authenticated user feature and client-side session-refresh optimizations). Make sure your implementation round-trips these keys cleanly — `getItem(key)` should return the same string that was last passed to `setItem(key, value)`. If your storage drops, filters, or namespaces keys so that they don't survive a round-trip, some optimizations may degrade for example, an extra `/v1/auth/try-refresh` round-trip may be made on every page load even for anonymous visitors.
581
+ > **Note:** `customStorage` backs the keys the SDK persists on your behalf (tokens, last-authenticated user). Make sure your implementation round-trips these keys cleanly — `getItem(key)` should return the same string that was last passed to `setItem(key, value)`. If your storage drops, filters, or namespaces keys so that they don't survive a round-trip, the features that rely on them may degrade.
582
+ >
583
+ > The internal, non-PII markers for the client-side session-refresh optimization (`DSLI` / `DSLI_DISABLED`) are the exception: the SDK always keeps them in real `window.localStorage`, independent of `customStorage`. This is what makes the optimization behave correctly even when you back the other keys with `sessionStorage` or an in-memory store.
582
584
 
583
585
  ### Last User Persistence
584
586
 
585
587
  Descope stores the last user information in local storage. If you wish to disable this feature, you can pass `storeLastAuthenticatedUser={false}` to the `AuthProvider` component. Please note that some features related to the last authenticated user may not function as expected if this behavior is disabled. Local storage is being cleared when the user logs out, if you want the avoid clearing the local storage, you can pass `keepLastAuthenticatedUserAfterLogout={true}` to the `AuthProvider` component.
586
588
 
587
- The last-user key also serves as a signal for the SDK's session initialization optimization: on mount, the `AuthProvider` skips the initial `/try-refresh` network call if no prior session indicator is found in `localStorage` (neither the last-user key nor the `DSLI` key written on every successful authentication). This means anonymous visitors never pay a round-trip at startup. If `storeLastAuthenticatedUser={false}`, only the `DSLI` key is used as the indicator.
589
+ The last-user key also serves as a signal for the SDK's session initialization optimization: on mount, the `AuthProvider` skips the initial `/try-refresh` network call when it finds no prior session indicator neither the `DSLI` key (written to real `window.localStorage` on every successful authentication, independent of `customStorage`) nor the last-user key. This means anonymous visitors never pay a round-trip at startup. If `storeLastAuthenticatedUser={false}`, only the `DSLI` key is used as the indicator.
588
590
 
589
591
  ### Seamless Session Migration
590
592
 
@@ -1,2 +1,2 @@
1
- "use strict";const e="undefined"!=typeof window;exports.IS_BROWSER=e,exports.baseHeaders={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.30.5"};
1
+ "use strict";const e="undefined"!=typeof window;exports.IS_BROWSER=e,exports.baseHeaders={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.30.7"};
2
2
  //# sourceMappingURL=constants.js.map
@@ -1,2 +1,2 @@
1
- const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.30.5"},d="undefined"!=typeof window;export{d as IS_BROWSER,e as baseHeaders};
1
+ const e={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.30.7"},d="undefined"!=typeof window;export{d as IS_BROWSER,e as baseHeaders};
2
2
  //# sourceMappingURL=constants.js.map