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 = SessionStatus.UNKNOWN, val expireAt: Long, val abandonAt: Long? = null, val lastActiveAt: Long, val latestActivity: SessionActivity? = null, val lastActiveOrganizationId: String? = null, val actor: JsonElement? = null, val user: User? = null, val publicUserData: PublicUserData? = null, val factorVerificationAge: List<Int>? = null, val createdAt: Long, val updatedAt: Long, val currentTask: SessionTask? = null, val tasks: List<SessionTask> = emptyList(), 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.

Link copied to clipboard
@Serializable
data class SessionTask(val key: String)
Link copied to clipboard
Link copied to clipboard
@Serializable
data class SessionVerification(val id: String? = null, val status: SessionVerification.Status = Status.UNKNOWN, val level: SessionVerification.Level = Level.UNKNOWN, val session: Session? = null, val supportedFirstFactors: List<Factor>? = null, val supportedSecondFactors: List<Factor>? = null, val firstFactorVerification: Verification? = null, val secondFactorVerification: Verification? = null)

Represents the state of an in-session reverification (step-up) flow.

Properties

Link copied to clipboard
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.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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.

Link copied to clipboard

Sends a verification code to the email address for first-factor reverification.

Link copied to clipboard

Sends an MFA code to the phone number for second-factor reverification.

Link copied to clipboard

Sends a verification code to the phone number for first-factor reverification.

Link copied to clipboard
suspend fun Session.startEnterpriseSso(emailAddressId: String? = null, enterpriseConnectionId: String? = null, redirectUrl: String? = null): ClerkResult<SessionVerification, ClerkErrorResponse>

Starts Enterprise SSO for first-factor reverification.

Link copied to clipboard

Starts an in-session reverification flow.

Link copied to clipboard

Verifies the current session with a backup code.

Link copied to clipboard

Verifies the current session with an email code.

Link copied to clipboard

Verifies the current session with a phone code as a second factor.

Link copied to clipboard
suspend fun Session.verifyWithPasskey(allowedCredentialIds: List<String> = emptyList()): ClerkResult<SessionVerification, ClerkErrorResponse>

Verifies the current session with a passkey via Android Credential Manager.

Link copied to clipboard

Verifies the current session by asking the user to re-enter their password.

Link copied to clipboard

Verifies the current session with a phone code as a first factor.

Link copied to clipboard

Verifies the current session with a TOTP code.