Skip to main content
A cross-platform Flutter plugin that wraps the native iOS and Android SDKs, providing a unified Dart API for identity verification.

GitHub Repository

View source code and examples on GitHub

pub.dev Package

didit_sdk

Requirements

Platform Requirements


Installation

Or add it manually to your pubspec.yaml:
Then run:

iOS Setup

The plugin selects the native iOS SDK variant from the DIDIT_SDK_IOS_NFC_ENABLED environment variable. Configure your ios/Podfile (the DiditSDK pod is not on CocoaPods trunk):
Install the full SDK with NFC (default):
Install the core SDK without NFC (removes NFCPassportReader, CoreNFC-linked code, and OpenSSL):
NFC-enabled iOS builds require a deployment target of iOS 15.0+; core-only builds can target iOS 13.0. When switching variants, clean CocoaPods first (rm -rf Pods Podfile.lock) so the previous SDK variant is not reused.

Android Setup

By default the plugin depends on the full Android SDK including NFC. To build without NFC, add this to android/gradle.properties:
This switches the dependency from me.didit:didit-sdk to me.didit:didit-sdk-core, removing the NFC reader module and its JMRTD/SCUBA/BouncyCastle dependencies. When NFC is enabled (default), add this packaging rule to android/app/build.gradle.kts to resolve a duplicate metadata file from BouncyCastle:
Without this rule the build fails with a mergeDebugJavaResource error. The rule is not needed when diditSdkAndroidNfcEnabled=false.
The Android native SDK resolves from a remote GitHub Maven repository (since plugin 3.4.0) — no manual Maven configuration is needed in your app.

Permissions

iOS

Add the following keys to your app’s Info.plist:
If any required iOS privacy key is missing, iOS terminates the app as soon as the SDK tries to access that protected resource. For example, missing NSCameraUsageDescription causes a crash when the user taps the document camera’s take photo button.

NFC Configuration

To enable NFC reading for passports and ID cards with chips:
  1. Add NFC Capability in Xcode:
    • Select your target > Signing & Capabilities > + Capability > Near Field Communication Tag Reading
  2. Add ISO7816 Identifiers to Info.plist:
  1. Add an entitlements file with NFC tag reading enabled:
Make sure the app’s provisioning profile includes the NFC Tag Reading capability. If the bundle ID is not configured for NFC in your Apple Developer account, Xcode will fail signing with a missing com.apple.developer.nfc.readersession.formats entitlement. This NFC configuration is not needed when DIDIT_SDK_IOS_NFC_ENABLED=false.

Android

The following permissions are declared in the SDK’s AndroidManifest.xml and merged automatically: Camera and NFC hardware features are declared as optional (android:required="false"), so your app can be installed on devices without these features. When diditSdkAndroidNfcEnabled=false, the Android NFC permission and feature are not added by the SDK.

Runtime Permissions

The SDK handles Android runtime permission requests automatically. When the user reaches a step that requires camera access:
  1. The SDK prompts for camera permission if not already granted
  2. If the user denies the permission, an error message is displayed with a Try Again button
  3. If the user grants the permission, the verification flow continues
You do not need to request camera permission in your app code before calling startVerification() — the SDK manages this internally.

Quick Start


Integration Methods

The SDK supports two integration methods: Create a session on your backend using the Create Verification Session API, then pass the token to the SDK:
This approach gives you full control over:
  • Associating sessions with your users (vendor_data)
  • Setting custom metadata
  • Configuring callbacks per session

Method 2: Workflow ID (Simpler Integration)

For simpler integrations, the SDK can create sessions directly using your workflow ID — no backend needed:
Advanced session parameters (contact_details, expected_details, metadata) are only supported through the Session Token method, where your backend calls the Create Session API with full parameter support. Pass the returned session_token to DiditSdk.startVerification().

Configuration

Customize the SDK behavior by passing a DiditConfig object:
For startVerificationWithWorkflow, pass config as a named parameter:

Configuration Options

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.
View All Supported Languages →

Advanced Session Parameters

Parameters like contact_details, expected_details, and metadata are only supported through the Session Token method. Your backend calls POST /v3/session/ with full parameter support, then passes the returned session_token to the SDK.
The Dart startVerificationWithWorkflow method only accepts workflowId, vendorData, and config. Pre-3.4.0 versions exposed contactDetails, expectedDetails, and metadata parameters, but these were removed because the Unilink endpoint does not honour them.

Handling Results

Both startVerification and startVerificationWithWorkflow return a Future<VerificationResult>. The result is a sealed class — use pattern matching to determine the outcome.

Result Cases

SessionData Properties

Error Types

The VerificationErrorType enum exposes the following cases:

Complete Result Handling Example


End-to-End Example (Backend Session → Flutter SDK → Webhook)

The production-ready integration: your backend creates the session, your Flutter app receives the session_token, and the SDK runs the flow. The final decision is delivered to your backend via webhook — never trust the client-side result alone.

1. Backend — create the session

2. Flutter — exchange and start the SDK

3. Backend — receive the final decision via webhook

See the Webhooks guide for HMAC signature verification details.

Complete Example