Skip to main content
Use the Kotlin SDK session APIs after authentication to restore wallet state, issue ID tokens, and manage credential access.

Session State

Completed wallet sessions are restored automatically when the Android-backed OMSClient is created.
val session = client.session

println("Wallet: ${session.walletAddress}")
println("Expires at: ${session.expiresAt}")
println("Login type: ${session.loginType}")
println("Email: ${session.sessionEmail}")
client.session reports completed wallet-session state. If an auth flow is interrupted before completion, complete it through the matching callback flow or start authentication again. Returns Returns OMSClientSessionState with walletAddress, expiresAt, loginType, and sessionEmail. expiresAt is an ISO-8601 timestamp string returned by the wallet API.

Session Expiry Events

Register an onSessionExpired listener when the app should react as soon as the active wallet session expires.
val unsubscribe = client.wallet.onSessionExpired { event ->
    println("Session expired at: ${event.expiredAt}")
    println("Expired wallet: ${event.session.walletAddress}")
}
Keep the listener active while the lifecycle owner needs updates. Call unsubscribe() during cleanup. Parameters
ParameterTypeDescription
listener(OMSClientSessionExpiredEvent) -> UnitCallback that receives session and expiredAt when the wallet session expires.
Returns Returns () -> Unit, an unsubscribe function that removes the listener. event.expiredAt is an ISO-8601 timestamp string returned by the wallet API.

List Wallets

List wallets available to the authenticated credential.
val wallets = client.wallet.listWallets()

for (wallet in wallets) {
    println("${wallet.id} ${wallet.type} ${wallet.address}")
}
Parameters Takes no parameters. Returns Returns List<Wallet>.

Get ID Token

Request an ID token for the active wallet session. Send this token to your backend when using backend wallet verification.
val idToken = client.wallet.getIdToken(ttlSeconds = 300u)
Parameters
ParameterTypeDescription
ttlSecondsUInt?Optional token lifetime in seconds.
customClaimsMap<String, JsonElement>?Optional app-provided claims. Backends should treat them as client-provided context unless they control the values.
Returns Returns String.

List Access

List wallet access grants for account-management UI.
val credentials = client.wallet.listAccess(pageSize = 25u)

for (credential in credentials) {
    println("${credential.credentialId} ${credential.expiresAt} ${credential.isCaller}")
}
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size for paginated access results.
Returns Returns List<CredentialInfo>.

Advanced: List Access Pages

Stream credential-access pages when your UI wants page-at-a-time rendering.
import kotlinx.coroutines.flow.collect

client.wallet.listAccessPages(pageSize = 25u).collect { page ->
    for (credential in page.credentials) {
        println("${credential.credentialId} ${credential.isCaller}")
    }
}
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size for each access-list request.
Returns Returns Flow<ListAccessResponse>.

Advanced: List Access Page

Fetch one credential-access page with an optional cursor.
val page = client.wallet.listAccessPage(pageSize = 25u)
val nextCursor = page.page?.cursor
Parameters
ParameterTypeDescription
pageSizeUInt?Optional page size for this request.
cursorString?Optional cursor returned by a previous page.
Returns Returns ListAccessResponse.

Revoke Access

Revoke another credential’s access to the active wallet.
client.wallet.revokeAccess(targetCredentialId = "credential-id")
Parameters
ParameterTypeDescription
targetCredentialIdStringCredential ID returned by listAccess.
Returns Returns Unit.

Sign Out

client.wallet.signOut()
Signing out clears the saved wallet session and authentication state. The user must authenticate again before wallet operations. Parameters Takes no parameters. Returns Returns Unit.