Current version
The latest Android Liveness SDK version is 0.0.12.Prerequisites
- Android minimum SDK: API level 24 (Android 7.0)
- Jetpack Compose enabled in your project
CAMERApermission declared in yourAndroidManifest.xml
Step 1 — Add the dependency
Add the Youverify Liveness SDK to your app module’sbuild.gradle.kts:
Step 2 — Declare the camera permission
Add the following to yourAndroidManifest.xml:
Step 3 — Generate tokens server-side
Before initializing the SDK you need two tokens generated by your backend. Neither token should be generated in your Android app. Generate session ID — callPOST /v2/api/sdk/session-id:
POST /v2/api/sdk/liveness-token:
Step 4 — Initialize and launch the SDK
Once you have thesessionId and sessionToken from your backend, initialize the SDK in a Composable:
Available liveness tasks
The SDK supports four task types. Pass them tolivenessController.start(tasks = listOf(...)):
Callback data
BothonSuccess and onFailure receive a LivenessData object:
boolean
true if the liveness check passed.string
Base64-encoded face image captured during the check.
string
Video clip of the user performing the liveness task.
object
Present only in failure cases. Contains
key (e.g. eyes_closed, image_capture_failed, invalid_or_expired_session) and message.Configuration options
string
Your Youverify public merchant key. Safe to embed in your app.
string
required
Session ID generated server-side via
POST /v2/api/sdk/session-id.string
required
Liveness auth token generated server-side via
POST /v2/api/sdk/liveness-token.boolean
default:"true"
Set to
false for production. Defaults to true (sandbox mode).SDKUser
User details for the liveness session.
firstName is required; lastName and email are optional.boolean
default:"false"
Set to
true to narrate task instructions to the user via audio.Supported document types
When using the Document Capture SDK for Android alongside the Liveness SDK, the following document types are supported for capture: passports, national identity cards, driver’s licences, and residence permits. For a full list of supported countries and document types, see the SDKs overview.Session tokens expire after a short period. If you receive an
invalid_or_expired_session error, generate fresh sessionId and sessionToken values from your backend and re-initialize the SDK.