List Sessions
Get all active sessions for the current user.- View active sessions across devices
- Identify suspicious login activity
- Manage session security
Revoke Session
Revoke/logout a specific session.ID of the session to revoke
Whether revocation was successful
Whether the revoked session was the current one
- User can only revoke their own sessions
- Revoking current session logs user out
- Session is permanently deleted from database
- Returns 404 if session not found or doesn’t belong to user
List Device Accounts
List all accounts connected on this device.- Track multiple accounts on the same device
- Enable quick account switching
- Maintain separate sessions per account
- Deduplicate by user ID
The current account is always included in the results, even if not in device sessions.
Bootstrap Device Session
Initialize device session tracking for current user.Whether bootstrap was successful
- Registers current session as a device session
- Required before account switching functionality works
- Sets cookies for device session management
- Called automatically on first login
Switch Device Account
Switch to a different account on this device.User ID to switch to
Whether switch was successful
ID of the account switched to
- Target user must have an active device session
- Cannot switch to already-active account (returns success immediately)
- Sets new session cookies
- Returns 404 if target account not found in device sessions
Delete Account
Permanently delete the current user’s account.Must be true to confirm deletion
Whether deletion was successful
Cascade Deletions:
Deleting a workspace cascades to:
- All boards in the workspace
- All posts on those boards
- All comments on those posts
- All votes and reactions
- All workspace members
- All workspace invitations
- Custom domains
- Branding configuration
- Changelogs
- Integrations
If you’re a member (but not owner) of other workspaces, your membership is retained after account deletion. Those workspaces are not affected.
Session Security
Best Practices:- Review active sessions regularly
- Revoke unknown or suspicious sessions immediately
- Use
userAgentandipAddressto identify sessions - Set reasonable session expiration times
- Sessions are created on login
- Session tokens stored in HTTP-only cookies
- Sessions expire based on better-auth configuration
- Manual revocation immediately invalidates session
- Each device/browser has separate session
- Session list shows all active sessions
- Current session clearly marked
- Can revoke sessions from any device