GitHub Repository
View source code and examples on GitHub
Native SDK: This is the recommended approach for Android apps. Native SDKs provide the best user experience, optimized camera handling, and full NFC support.
Requirements
Feature availability by API level: Document and face auto-detection use MediaPipe (API 24+). On API 23 devices the SDK falls back to manual capture with a timed shutter button. All other features work across the full API 23+ range.
Installation
Step 1: Add the Repository
Add the Didit Maven repository to therepositories block in your settings.gradle.kts:
settings.gradle (Groovy):
Step 2: Add the Dependency
Add the SDK dependency to your app’sbuild.gradle.kts:
(!) Regarding the version ensure you check the GitHub repository for the latest version.
build.gradle (Groovy):
SDK variants
The Android SDK ships as four separate artifacts, so your app only pays the binary cost of the features it uses.me.didit:didit-sdk above is the full bundle. Pick exactly one:
Since
4.6.0, native WalletConnect wallet-signing ships as its own optional add-on, me.didit:didit-sdk-wallet.
The full me.didit:didit-sdk bundle already includes it, so nothing changes if you install the bundle.
If you use one of the slimmer artifacts and want wallet-ownership confirmation to run natively inside your app, add me.didit:didit-sdk-wallet next to it; without the add-on the SDK completes wallet ownership through a secure browser flow instead, so the feature keeps working either way.
Moving WalletConnect out of didit-sdk-core also removed several megabytes of wallet dependencies from every build that does not need them.
All artifacts are published at the same version, so keep them on 4.6.0.
Keeping the download small
The detection models used for auto-capture are downloaded at runtime and cached, so they never count against your app’s size. What auto-capture adds to your app is the ML runtime’s native library, and that cost is per CPU architecture: roughly 10 MB forarm64-v8a, 7 MB for armeabi-v7a, and 13 MB for each of the two x86 emulator architectures.
To pay that cost only once:
- Publish an Android App Bundle (AAB). Google Play delivers only the device’s own architecture and languages, so an arm64 phone installs roughly 10 MB of native code (about 4 MB of compressed download). A universal APK instead packs all four architectures — over 40 MB — which is the most common cause of unexpectedly large size measurements.
-
If you distribute a single APK and your audience is ARM phones and tablets, restrict the bundled architectures:
Keep every ABI your users actually run — add
x86_64if you target Chromebooks or other x86 devices, or publish per-ABI APK splits so no device loses support. -
Enable R8 —
isMinifyEnabled = trueandisShrinkResources = truein your release build type (minifyEnabled true/shrinkResources trueif you use Groovybuild.gradle). The SDK ships its own consumer rules, so unused SDK code is stripped with no extra configuration. -
Limit bundled languages with
resConfigs(...)if you do not need all 48 SDK locales in an APK build; AAB language splits handle this automatically on Google Play.
Step 3: Add Packaging Exclusion
Add this to your app’sandroid block to avoid build conflicts:
Permissions
The SDK requires the following permissions. These are declared in the SDK’sAndroidManifest.xml and will be merged automatically into your app’s manifest:
Camera and NFC Features
The SDK declaresandroid.hardware.camera and android.hardware.nfc as optional features (android:required="false"). This ensures your app can be installed on devices without a camera or NFC hardware — the SDK will gracefully handle missing hardware at runtime.
Quick Start
Step 1: Initialize the SDK
Initialize the SDK in yourApplication.onCreate():
Step 2: Start Verification and Handle Results
Integration Methods
The SDK supports two integration methods:Method 1: UniLink (Simplest)
No backend required. The SDK creates the session directly using your workflow ID from the Didit Console. Limited tovendorData only.
Method 2: Backend Session (Recommended for Production)
Your backend creates the session via the Create Verification Session API (POST /v3/session/) with full parameter support (contact_details, expected_details, metadata, callback, etc.), then passes the session_token to the SDK.
- Associating sessions with your users (
vendor_data) - Setting custom metadata
- Configuring callbacks per session
- Providing contact details and expected details for cross-validation
Configuration
Customize the SDK behavior:Configuration Options
Options
showCloseButton, showExitConfirmation, and closeOnComplete match the Web SDK’s DiditSdkConfiguration. Mobile-specific options languageLocale and fontFamily exist because the mobile SDK renders the full verification UI natively (unlike the Web SDK which delegates to the hosted frontend inside an iframe).Theming & Colors: Colors, backgrounds, and intro screen settings are configured through your White Label settings in the Didit Console, not in the SDK configuration. This ensures consistent branding across all platforms.
Language Support
The SDK supports 53 languages. If no language is specified, the SDK uses the device locale with English as fallback.Advanced Options
For advanced session parameters (contact_details, expected_details, metadata, callback), use the Backend Session method. Your backend calls the Create Verification Session API with full parameters, then passes the session_token to the SDK.
Handling Results
TheVerificationResult sealed class provides the outcome of the verification:
Result Cases
SessionData Properties
Error Types
All errors are sealed subclasses ofme.didit.sdk.VerificationError:
Complete Result Handling Example
Observing SDK State
You can observe the SDK state for custom loading UI:ProGuard / R8
The SDK includes its own consumer ProGuard rules. No additional configuration is needed. If you use R8 full mode, you may need to add this to yourgradle.properties:
End-to-End Example (Backend Session → Android SDK → Result)
This pattern is the production-ready integration. Your backend creates the session, your Android app receives thesession_token, and the SDK runs the flow.