Package-level declarations

Types

Link copied to clipboard
data class GetTokenOptions(val template: String? = null, val skipCache: Boolean = false, val expirationBuffer: Long = 10)

Options for configuring session token retrieval behavior.

Link copied to clipboard
@Serializable
data class Session(val id: String, val status: Session.SessionStatus, val expireAt: Long, val abandonAt: Long, val lastActiveAt: Long, val latestActivity: SessionActivity? = null, val lastActiveOrganizationId: String? = null, val actor: String? = null, val user: User? = null, val publicUserData: PublicUserData? = null, val createdAt: Long, val updatedAt: Long, val lastActiveToken: TokenResource? = null)

The Session object is an abstraction over an HTTP session. It models the period of information exchange between a user and the server.

Link copied to clipboard
@Serializable
data class SessionActivity(val id: String, val browserName: String? = null, val browserVersion: String? = null, val deviceType: String? = null, val ipAddress: String? = null, val city: String? = null, val country: String? = null, val isMobile: Boolean? = null)

A SessionActivity object will provide information about the user's location, device and browser.

Properties

Link copied to clipboard

Convenience accessor to tell if the given session is the current device. Used mostly for constructing the User profile security view.

Functions

Link copied to clipboard

Deletes the current session.

Link copied to clipboard
suspend fun Session.fetchToken(options: GetTokenOptions = GetTokenOptions()): ClerkResult<TokenResource, ClerkErrorResponse>

Fetches a fresh JWT for the session.

Link copied to clipboard

Revokes the current session.