Package-level declarations

Types

Link copied to clipboard
data class AllowedDocument(val displayName: String?, val description: String?, val documentType: NonIdDocumentType, val allowedFileTypes: List<String>)

One document an InputRequest.UploadNonIdDocument step accepts. The host lets the user pick one and answers with it, in StepInput.UploadNonIdDocument.

Link copied to clipboard

File kind allowed for non-ID document upload. A document can accept Image, Pdf, or ImageOrPdf (both).

Link copied to clipboard
Link copied to clipboard
data class CardDate(val day: Int?, val month: Int?, val year: Int?)

A date on the card, as the scanner read it; a part it didn't read is null.

Link copied to clipboard
data class CardScanResult(val cardNumber: String, val expiryDate: CardDate, val owner: String?, val cvv: String?)

The card a successful EngineStepType.CardScan step read, in full: the masking the backend asks for applies only to what Engine sends it. Delivered as StepOutput.CardScan on the first StepResult showing the backend took the card; there is no separate listener.

Link copied to clipboard
Link copied to clipboard
object Engine

Entry point for the Microblink Platform Engine API.

Link copied to clipboard
data class EngineConfiguration(val service: ServiceSettings, val appearance: ScannerAppearance? = null)

Configuration for an Engine verification session.

Link copied to clipboard
sealed class EngineError

A failure surfaced by Engine. The caller should not infer retry behavior from the error type alone; it should use StepResult.Failed.recoverable and StepResult.Failed.retryAction.

Link copied to clipboard
class EngineException(val error: EngineError, message: String) : Exception

An Engine.startSession failure whose reason Engine can name as an error. Today that is only EngineError.UnsupportedWorkflowVersion.

Link copied to clipboard

Lets Engine know which of the app's Activities is in front, so it can start scanner steps from it. androidx.startup runs it when the app starts, from Engine's manifest, so an app has nothing to do.

Link copied to clipboard
sealed class EngineStatus

Transient execution status of a session — what Engine is doing right now. This is a side channel for loading and progress UI only; workflow data, next-step info, blockers, and terminal outcomes all live on StepResult.

Link copied to clipboard
data class EngineStepProgress(val type: EngineStepType, val status: EngineStepStatus)

Which scanner step Engine is running, and how far it is.

Link copied to clipboard

How far a scanner step is.

Link copied to clipboard

Types of steps that Engine runs itself by launching a scanner SDK, which the app includes (see EngineError.MissingScannerSdk).

Link copied to clipboard
sealed class ExpectedInput

The input kind Engine expected for the current step, reported by EngineError.InvalidNextInput.

Link copied to clipboard

The kind of file a file field asks for. Engine takes a JPEG, PNG or PDF for either.

Link copied to clipboard
sealed class FormField

Description of a single form field. The host owns rendering, how errors show, file picking, and upload preparation; Engine checks the answers (see EngineError.InvalidFormInput). Each variant is answered by the matching FormFieldValue variant.

Link copied to clipboard
data class FormFieldError(val fieldName: String, val reason: FormFieldErrorReason)

Why one submitted form value was rejected — see EngineError.InvalidFormInput.

Link copied to clipboard

Why Engine rejected one form value — see FormFieldError.

Link copied to clipboard
sealed class FormFieldValue

Strongly-typed value for a single FormField. The variant must match the descriptor's variant (e.g. a FormField.Number(Integer) is answered with Integer). A null value leaves the field unanswered, which only an optional field allows.

Link copied to clipboard

A kind of host-collected input: a form (StepInput.FormSubmission) or one of the two uploads.

Link copied to clipboard
sealed class InputRequest

A host-rendered step's descriptor. The host owns rendering, how errors show, and file picking; Engine checks what comes back (see EngineError.InvalidFormInput and EngineError.InvalidUploadInput).

Link copied to clipboard

The kinds of interactive step a host can meet in WorkflowProgress.steps. The workflow's non-interactive steps (Start, DbVer, TrustScore, End) and step types this build doesn't recognize are left out of it.

Link copied to clipboard
data class NetworkRetryPolicy(val maxAttempts: Int = 5, val retryDelayMillis: Long = 500)

How hard Engine tries before reporting a failure.

Link copied to clipboard

The kinds of non-ID document the backend knows. A type added after this build shipped reads as Unknown. The host answers with the AllowedDocument itself, so Engine still sends the type the backend named, however many read as Unknown.

Link copied to clipboard
Link copied to clipboard
sealed class RequiredPermission

A runtime permission an Engine-run step requires.

Link copied to clipboard
sealed class RetryAction

How a recoverable failure can be retried.

Link copied to clipboard
data class ScannerAppearance(val colors: ScannerColors? = null, val typography: ScannerTypography? = null)

The look of the scanner and face screens Engine runs. A null here, or a null part of it, keeps that SDK's own default light look: 2.0.0 never follows the phone's dark setting.

Link copied to clipboard
data class ScannerColors(@ColorInt val primary: Int, @ColorInt val onPrimary: Int, @ColorInt val surface: Int, @ColorInt val onSurface: Int)

The colors of the scanner and face screens, named after the design's roles. Engine uses surface as the SDKs' background, and onSurface as the text on it.

Link copied to clipboard
data class ScannerTypography(val onboardingTitle: TextStyle? = null, val onboardingText: TextStyle? = null, val onboardingButton: TextStyle? = null, val helpDialogTitle: TextStyle? = null, val helpDialogText: TextStyle? = null, val helpDialogButton: TextStyle? = null, val errorDialogTitle: TextStyle? = null, val errorDialogText: TextStyle? = null, val errorDialogButton: TextStyle? = null, val scanningInstructions: TextStyle? = null, val helpTooltip: TextStyle? = null, val loadingScreen: TextStyle? = null, val faceCaptureInstructions: TextStyle? = null)

The fonts of the scanner and face screens. A style replaces that text's whole default style, so set its size too; a null style keeps the SDK's own. A style's color may be ignored, because the scanner screens take their text colors from ScannerColors.

Link copied to clipboard
data class ServiceSettings(val sdkConfiguration: String, val retryPolicy: NetworkRetryPolicy = NetworkRetryPolicy.Default)

Everything the SDK needs to execute a transaction the customer backend has already created.

Link copied to clipboard
interface Session

A single verification session.

Link copied to clipboard
sealed class SessionOutcome

Terminal result of a session. Carried by StepResult.Finished and returned by Session.cancel; there is no separate outcome listener.

Link copied to clipboard
data class SessionStart(val session: Session, val first: StepResult)

A live, already-started session together with the first StepResult of its workflow.

Link copied to clipboard
data class Step(val id: Int, val type: InteractiveStepType, val name: String?, val description: String?, val isCompleted: Boolean, val isCurrent: Boolean, val attemptCount: Int, val isSecondOfSameKind: Boolean, val interactiveIndex: Int?)

Describes a single interactive workflow step.

Link copied to clipboard
sealed class StepAction

The next workflow action the caller should handle.

Link copied to clipboard
sealed class StepBlocker

A host-owned condition that must be resolved before Engine can run the next step.

Link copied to clipboard
sealed class StepInput

Input passed to Session.next.

Link copied to clipboard
sealed class StepOutput

Output produced by an Engine-run step that the host may consume directly: today, only the card an EngineStepType.CardScan step read.

Link copied to clipboard
sealed class StepResult

The full snapshot returned from Engine.startSession and every Session.next. It is the durable source of truth for transaction id, workflow, the next action, blockers, recoverable failures, and terminal outcomes.

Link copied to clipboard

Why a step's attempt was turned down — see EngineError.StepValidation.

Link copied to clipboard
Link copied to clipboard
class UploadFile(val contentType: String, val fileName: String, val sizeBytes: Long? = null, val openStream: () -> InputStream)

A host-provided file payload for every host-rendered upload. A plain class, not a data class: it has identity equality, so the enclosing StepInput values do too — never compare upload inputs by value.

Link copied to clipboard
Link copied to clipboard

A side of an ID document — see EngineError.InvalidUploadInput.side.

Link copied to clipboard

The backend's verdict. One this SDK doesn't know reads as Review.

Link copied to clipboard
data class WorkflowProgress(val stepCount: Int?, val interactiveStepCount: Int?, val hasConditionalInteractiveStep: Boolean, val isKioskModeEnabled: Boolean, val steps: List<Step>, val currentStepId: Int?, val completedStepIds: List<Int>)

Snapshot of the workflow's progress as known to Engine at a point in the session. Carries the data a home / progress screen needs. steps lists interactive steps only; the counts are null until the backend has sent a snapshot.