Current version
The latest Android Liveness SDK version is 0.0.15.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/identity/sdk/session/generate:
POST /v2/api/identity/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:
Present only in failure cases. Contains
key (e.g. eyes_closed, image_capture_failed, invalid_or_expired_session) and message.Configuration options
Liveness auth token generated server-side via
POST /v2/api/identity/sdk/liveness/token.User details for the liveness session.
firstName is required; lastName and email are optional.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.