A TokenStorage adapter that persists tokens in sessionStorage.
Tokens survive page reloads within the same tab but are cleared when the
tab is closed or the session ends. This prevents token leakage across
tabs and is a good default for sites where users do not expect persistent
sessions (e.g. embedded checkout widgets, kiosk-mode UIs).
Security note:sessionStorage is accessible to any JavaScript on the
same origin and tab. It is more isolated than localStorage (no
cross-tab sharing), but the default in-memory storage is still safer for
high-security use cases.
Parameters
Optionalkey: string
The sessionStorage key used to store tokens.
Defaults to 'lw:tokens'. Override this if you have multiple
LedeWire integrations on the same origin.
A TokenStorage adapter that persists tokens in
sessionStorage.Tokens survive page reloads within the same tab but are cleared when the tab is closed or the session ends. This prevents token leakage across tabs and is a good default for sites where users do not expect persistent sessions (e.g. embedded checkout widgets, kiosk-mode UIs).
Security note:
sessionStorageis accessible to any JavaScript on the same origin and tab. It is more isolated thanlocalStorage(no cross-tab sharing), but the default in-memory storage is still safer for high-security use cases.