Turnkey home page
Search...
⌘K
Ask AI
Demo
Login
Get started
Get started
Search...
Navigation
SDK reference
storeSession()
Documentation
SDK reference
API reference
Security
Changelogs
Support
Blog
Contact us
SDK reference
Introduction
React
React Native
Flutter
Swift
TypeScript | Frontend
Overview
Getting Started
Authentication
Advanced backend authentication
Advanced API requests
Legacy (@turnkey/sdk-browser)
SDK reference
addOauthProvider()
addPasskey()
clearAllSessions()
clearSession()
clearUnusedKeyPairs()
completeOauth()
completeOtp()
connectWalletAccount()
constructor()
createApiKeyPair()
createPasskey()
createWallet()
createWalletAccounts()
deleteSubOrganization()
disconnectWalletAccount()
exportPrivateKey()
exportWallet()
exportWalletAccount()
fetchUser()
fetchWalletAccounts()
fetchWallets()
getActiveSessionKey()
getAllSessions()
getProxyAuthConfig()
getSession()
getWalletProviders()
importPrivateKey()
importWallet()
init()
initOtp()
loginOrSignupWithWallet()
loginWithOauth()
loginWithOtp()
loginWithPasskey()
loginWithWallet()
logout()
refreshSession()
removeOauthProviders()
removePasskeys()
removeUserEmail()
removeUserPhoneNumber()
setActiveSession()
signAndSendTransaction()
signMessage()
signTransaction()
signUpWithOauth()
signUpWithOtp()
signUpWithPasskey()
signUpWithWallet()
storeSession()
switchWalletProviderChain()
updateUserEmail()
updateUserName()
updateUserPhoneNumber()
verifyOtp()
switchWalletAccountChain()
fetchPrivateKeys()
TypeScript | Server
Golang
Rust
Ruby
CLI
Python
Web3 libraries
Advanced
Migration Path
SDK reference
storeSession()
Copy page
Copy page
Overview
Stores a session token and updates the session associated with the specified session key, or by default the active session.
This function parses and stores a signed JWT session token in local storage, associating it with the given session key.
If a sessionKey is provided, the session will be stored under that key; otherwise, it will use the default session key.
If a session already exists for the session key, its associated key pair will be deleted before storing the new session.
After storing the session, any unused key pairs are automatically cleared from storage.
Ensures that session management is consistent and prevents orphaned key pairs.
Package:
core
Defined in:
core.ts:3542
Parameters
params
object
required
Show params details
params.
sessionKey
string
session key to store the session under (defaults to the default session key).
params.
sessionToken
string
required
JWT session token to store.
Response
A successful response returns the following fields:
returns
void
required
A promise that resolves when the session is successfully stored.
Was this page helpful?
Yes
No
signUpWithWallet()
switchWalletProviderChain()
Assistant
Responses are generated using AI and may contain mistakes.