The Android SDK ru.neurovision.kyc:kyc-sdk (Kotlin, Jetpack Compose) runs the session in its own activity and returns the result through the Activity Result API.
Requirements
| minSdk |
| compileSdk |
| Android Gradle Plugin |
| Kotlin |
| Devices |
An x86_64 device or emulator with ARM translation runs the app as ARM. If the app brings x86_64 libraries of its own, it runs as x86_64, and the session ends at once as Failed(UnsupportedDevice) — show the user that this device is not supported. Test on a device or an arm64 emulator.
The SDK brings Jetpack Compose (through the Compose BOM it was built with): an app on an older Compose is moved up to that version. androidx.activity is an API dependency, since NeuroVisionKyc.contract() returns its ActivityResultContract.
Installation
Until the SDK is on Maven Central, it comes as a Maven repository folder in the SDK package (sdk/android/maven/). Copy it into your project, for example as third_party/neurovision-maven/, and add it as a repository in settings.gradle.kts:
dependencyResolutionManagement {
repositories {
maven {
url = uri(settingsDir.resolve("third_party/neurovision-maven"))
content { includeGroup("ru.neurovision.kyc") }
}
google()
mavenCentral()
}
} Add the dependency in the app module:
dependencies {
implementation("ru.neurovision.kyc:kyc-sdk:0.6.2")
} The SDK's own dependencies (AndroidX, Compose, Kotlin) come from Google's Maven and Maven Central as usual. Once the SDK is on Maven Central, the maven { … } block goes and nothing else changes.
The SDK asks for the camera permission itself; there is nothing to add to the manifest.
Usage
import ru.neurovision.kyc.*
val kyc = registerForActivityResult(NeuroVisionKyc.contract()) { result ->
when (result) {
is KycResult.Completed -> result.verdict // Success | Failed | Suspicious | Expired | Unknown
KycResult.Cancelled -> Unit // the user left before the end
is KycResult.Failed -> result.reason // CameraDenied | Network | Server | Camera | Config | UnsupportedDevice | Internal
}
}
kyc.launch(KycRequest(apiHost, schemaId, clientKey)) // a scenario and the key your server minted
kyc.launch(KycRequest(apiHost, KycIdentity.Task(taskId))) // or a task the server created What each result means and what to show the user — Results. Where apiHost, schemaId, clientKey and taskId come from — Server integration.
API
| Declaration | What |
|---|---|
NeuroVisionKyc.contract() | The ActivityResultContract<KycRequest, KycResult> that runs a session |
NeuroVisionKyc.VERSION | The SDK’s version |
KycRequest(apiHost, schemaId, clientKey, clientUser = null, language = null, theme = KycTheme.Auto) | A session for a scenario and the key your server minted |
KycRequest(apiHost, identity, clientUser = null, language = null, theme = KycTheme.Auto) | A session for an identity: KycIdentity.Schema(schemaId, clientKey) or KycIdentity.Task(taskId) |
clientUser | Optional. The user’s ID in your system, up to 36 characters, in plain text. The same value in all attempts of one person groups them; do not pass personal data. See Working with clientKey |
language | The interface language, ISO 639-1 ("en", "ru", …; "zh-CN" for Simplified Chinese). null: the scenario’s language, else the device’s. A language the scenario does not offer is ignored |
theme | KycTheme.Auto (the scenario’s choice, else the device’s), Light, Dark |
KycResult | Completed(verdict: KycVerdict), Cancelled, Failed(reason: KycFailure, message: String?) |
A printed KycIdentity.Schema leaves the client key out (clientKey=<redacted>), so logging a request does not log the key.
Things to know
- One session at a time. A second launch while one runs ends at once as
Failed(Config, "a KYC session is already running"). launchMode. Keep the launching activitystandardorsingleTop. WithsingleTask, a user who leaves the app during the session and comes back through the launcher icon brings that activity to the front, Android finishes the SDK's screen above it, and the result isCancelled.- The session's screen is portrait.
apiHostmust behttps; plainhttpis accepted only for the device itself (localhost,127.x.x.x).- If Android kills the app's process while the session is on screen, the result is lost.
- Screen capture. The session's screen is protected with
FLAG_SECURE: screenshots, screen recording, casting and the recents thumbnail show it black. - Release builds. The AAR carries its own R8 rules; there is nothing to add to your
proguard-rules.pro.
Analytics (optional)
The SDK can send product analytics to the PostHog project your app names in its manifest; the SDK itself carries no key. In AndroidManifest.xml:
<application …>
<meta-data android:name="NeuroVisionKycPostHogKey" android:value="phc_…" />
<meta-data android:name="NeuroVisionKycPostHogHost" android:value="https://us.i.posthog.com" />
</application> Without a key the SDK sends no analytics. Keep the key out of git: a manifest placeholder (manifestPlaceholders) filled from a Gradle property or an environment variable. What is sent — Analytics and privacy.
Privacy
The session sends the NeuroVision server the document photo, the liveness check photos and video, and the device's facts (model, OS, language, time zone, screen) with its emulator and tampering signals, for fraud prevention. Declare them in your app's Data safety form — see Analytics and privacy.