Sessions
Validate tokens and manage user sessions
Use scalekitClient.sessions() 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
Runs getSession and returns the result.
paramsessionIdString
Session ID.
returnsSessionDetails
The response payload for this operation.
scalekitClient.sessions().getSession("sess_123");getUserSessions
Section titled “getUserSessions”#asyncgetUserSessions
Runs getUserSessions and returns the result.
paramuserIdString
Scalekit user ID (usr_...).
parampageSizeInteger
Page size.
parampageTokenString
Page token.
paramfilterUserSessionFilter
Result filter.
returnsUserSessionDetails
The response payload for this operation.
import com.scalekit.grpc.scalekit.v1.sessions.UserSessionFilter;
UserSessionFilter filter = UserSessionFilter.newBuilder().build();
scalekitClient.sessions().getUserSessions("user_123", 20, "", filter);revokeSession
Section titled “revokeSession”#asyncrevokeSession
Runs revokeSession and returns the result.
paramsessionIdString
Session ID.
returnsRevokeSessionResponse
Empty on success.
scalekitClient.sessions().revokeSession("sess_123");revokeAllUserSessions
Section titled “revokeAllUserSessions”#asyncrevokeAllUserSessions
Runs revokeAllUserSessions and returns the result.
paramuserIdString
Scalekit user ID (usr_...).
returnsRevokeAllUserSessionsResponse
Empty on success.
scalekitClient.sessions().revokeAllUserSessions("user_123");