Authorization SessionsUSER-ONLY
User Walkthrough 21 of 50
Users can view and remove the account’s authorization sessions.
Listing Sessions
To get the sessions as AuthorizationSession objects, call getAuthorizationSessions.
const sessions = await client.getAuthorizationSessions();
for (const session of sessions) {
console.log(session.appName, session.deviceModel, session.ipAddress);
}
The current session has isCurrent set to true.
Removing a Session
removeAuthorizationSession accepts the session’s identifier.
await client.removeAuthorizationSession(sessionId);
Removing Other Sessions
removeAuthorizationSessions removes every session except the current one.
await client.removeAuthorizationSessions();