Session

interface Session

A single verification session.

Owned by a host object that survives configuration changes, such as a ViewModel. Durable workflow data is returned from Engine.startSession and Session.next; status is a side channel for transient execution states only.

Properties

Link copied to clipboard
abstract val status: StateFlow<EngineStatus>

Transient execution status, for loading and progress UI only. Durable workflow data is returned from Engine.startSession and next.

Link copied to clipboard
abstract val transactionId: String

The transaction this session runs: the one the customer backend created.

Functions

Link copied to clipboard
abstract suspend fun cancel(reason: CancelReason): SessionOutcome.Canceled

Ends the session as canceled and, unless it already finished, tells the backend without waiting for its answer. A next call in flight is abandoned, closing a scanner it has open, and returns the StepResult.Finished carrying this outcome. Calling it again returns the first outcome.

Link copied to clipboard
abstract suspend fun next(input: StepInput = StepInput.None): StepResult

Drives the workflow forward by exactly one host-visible step. It is the only advancement mechanism.