Turnkey home page
Search...
⌘K
Ask AI
Demo
Login
Get started
Get started
Search...
Navigation
SDK reference
clearSession()
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
clearSession()
Copy page
Copy page
Overview
Clears the session associated with the specified session key, or the active session by default.
This function deletes the session and its associated key pair from storage.
If a sessionKey is provided, it will clear the session under that key; otherwise, it will clear the default (active) session.
Removes the session data from local storage and deletes the corresponding API key pair from the key store.
Throws an error if the session does not exist or if there is an error during the clearing process.
Package:
core
Defined in:
core.ts:3575
Parameters
params
object
Show params details
params.
sessionKey
string
session key to clear the session under (defaults to the default session key).
Response
A successful response returns the following fields:
returns
void
required
A promise that resolves when the session is successfully cleared.
Was this page helpful?
Yes
No
clearAllSessions()
clearUnusedKeyPairs()
Assistant
Responses are generated using AI and may contain mistakes.