Skip to main content

Install & configure

The Flutter SDK ships as the drukverify_flutter package. It is distributed via a private GitHub repository under the DrukVerify organization; ask your integration contact for an invite if you don't already have access.

Add to pubspec

dependencies:
drukverify_flutter:
git:
url: git@github.com:DrukVerify/drukverify-flutter.git
ref: v2.2.0
drukverify_flutter_generated:
git:
url: git@github.com:DrukVerify/drukverify-flutter.git
ref: v2.2.0
path: lib/src/_generated

Both packages must come from the same ref so the generated model types match the SDK's runtime expectations. Pin to a specific tag (v2.2.0 is the current release; v2.1.3 is the minimum floor — earlier 2.1.x versions have known bugs) rather than tracking main.

Then flutter pub get.

Platform setup

Android

The widget uses the camera and runs ML Kit face detection on-device. Add to android/app/src/main/AndroidManifest.xml inside <manifest>:

<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />

Minimum SDK 24 (android/app/build.gradle).

iOS

Add to ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Required to capture identity photos and run liveness checks.</string>

Minimum deployment target iOS 13.

First call

import 'package:drukverify_flutter/drukverify_flutter.dart';

final client = EkycClient(
config: EkycConfig(
host: 'https://api.drukverify.com',
apiKey: 'pk_test_…', // your public key
tokenProvider: () => fetchSessionFromYourBackend(),
),
);

The client is safe for app-wide use — construct one instance and share it. tokenProvider is called lazily on the first authenticated request and again on any 401 (single-flight reactive refresh).

What you get

  • client.ocrScanImages(image:, backImage:) — document OCR (multipart upload helper)
  • client.faceVerifyImages(imageA:, imageB:) — 1:1 face match (multipart upload helper)
  • client.livenessCheckImage(File) — single-frame liveness POST (multipart upload helper)
  • client.face, client.ocr, client.liveness, client.sessions — generated sub-APIs for endpoints that take JSON bodies (face register / search / dedupe, OCR list / get / delete, liveness challenge create / check get, session create / revoke)

The widget surface is not a separate import — the v2 SDK exposes EkycLivenessWidget from the top-level package:drukverify_flutter/drukverify_flutter.dart. See EkycLivenessWidget for usage.