Sessions
Validate tokens and manage user sessions
Use the Session client to inspect session metadata and revoke sessions when users sign out or you detect risk.
Typical flows: load a session by ID after authentication, list a user’s sessions for a security UI, and revoke one session or all of a user’s sessions on logout.
GetSession
Section titled “GetSession”#asyncGetSession
GetSession retrieves session details by session ID
Request context
Session ID.
The response payload for this operation.
session, err := scalekitClient.Session().GetSession(ctx, "ses_123")if err != nil { // handle}_ = sessionGetUserSessions
Section titled “GetUserSessions”#asyncGetUserSessions
GetUserSessions retrieves all session details for a user
Request context
Scalekit user ID (usr_...).
Page size.
Page token.
Result filter.
The response payload for this operation.
resp, err := scalekitClient.Session().GetUserSessions(ctx, "usr_123", 10, "", nil)if err != nil { // handle}_ = resp.SessionsRevokeSession
Section titled “RevokeSession”#asyncRevokeSession
RevokeSession revokes a session for a user
Request context
Session ID.
Empty on success.
resp, err := scalekitClient.Session().RevokeSession(ctx, "ses_123")if err != nil { // handle}_ = respRevokeAllUserSessions
Section titled “RevokeAllUserSessions”#asyncRevokeAllUserSessions
RevokeAllUserSessions revokes all sessions for a user
Request context
Scalekit user ID (usr_...).
Empty on success.
resp, err := scalekitClient.Session().RevokeAllUserSessions(ctx, "usr_123")if err != nil { // handle}_ = resp