attest

abstract suspend fun attest(request: ISessionsAttestParameters): SessionsAttestResponse

Attests the current session using a Stytch Trusted Auth Token. Calls the POST /sdk/v1/sessions/attest endpoint.

Kotlin:

StytchConsumer.sessions.attest(
SessionsAttestParameters(
profileId = "profile-id",
token = "integrity-token",
)
)

iOS:

let params = SessionsAttestParameters(profileId: "profile-id", token: "integrity-token")
let response = try await StytchConsumer.sessions.attest(params)

React Native:

StytchConsumer.sessions.attest({ profileId: "profile-id", token: "integrity-token" })

Return

SessionsAttestResponse containing the updated session.

Parameters

request
  • ISessionsAttestParameters

  • profileId — The device profile ID from the integrity provider.

  • token — The Stytch Trusted Auth Token

  • sessionDurationMinutes? — If provided, extends the session by this many minutes.

Throws

StytchError

if the attestation token is invalid.

if the coroutine is cancelled.