Account.logout()
Clear authentication state (logout).
Type: static
Signature
static logout(apiKey: string): voidParameters
apiKey
Type: string
API key for JAW services. Used to scope the storage operation.
Returns
void
Behavior
This method clears the current authentication state:
- Removes the authenticated address from storage
- Clears the current credential ID association
- Does not remove stored passkey accounts (user can still login later)
After logout:
Account.getAuthenticatedAddress()returnsnullAccount.get()without credentialId will throwAccount.getStoredAccounts()still returns all accounts
Example
import { Account } from '@jaw.id/core';
Account.logout('your-api-key');
console.log('Logged out');Important Notes
- Logout is local only - it doesn't affect the smart account
- Stored passkey accounts remain available for future login
- The user can still access their account by logging in again
Related
- Account.get() - Login to an account
- Account.getAuthenticatedAddress() - Check authentication status
- Account.getStoredAccounts() - List available accounts