Authorization SessionsUSER-ONLY

User clients can view and remove the account’s authorization sessions.

Listing Sessions

Use getAuthorizationSessions to get the sessions as AuthorizationSession objects.

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

Use removeAuthorizationSession with the session’s identifier.

await client.removeAuthorizationSession(sessionId);

Removing Other Sessions

Use removeAuthorizationSessions to remove every session except the current one.

await client.removeAuthorizationSessions();