Skip to main content

Install & configure

The Flutter SDK ships as the drukverify_flutter package, distributed through a private GitHub repository under the DrukVerify organization. Ask your integration contact for an invite if you don't already have access. The current release is 2.5.0.

Add to pubspec​

dependencies:
drukverify_flutter:
git:
url: git@github.com:DrukVerify/drukverify-flutter.git
ref: v2.5.0
drukverify_flutter_generated:
git:
url: git@github.com:DrukVerify/drukverify-flutter.git
ref: v2.5.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 a tag rather than tracking main. Then flutter pub get.

Platform setup​

The liveness widget uses the camera and runs ML Kit face detection on-device. Since 2.5.0 the SDK asks for the camera permission only; if an earlier release made you add microphone entries, remove them.

Android​

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 23 (android/app/build.gradle), the floor of the CameraX plugin the SDK uses.

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 15.5, the floor of the ML Kit face detection plugin.

First call​

import 'package:drukverify_flutter/drukverify_flutter.dart';

final client = EkycClient(
config: EkycConfig(
host: 'https://api.drukverify.com',
apiKey: 'dv_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 a 401, after which the request is retried once.

What you get​

Multipart helpers on EkycClient:

  • client.ocrScanImages(image:, backImage:) — document OCR
  • client.faceVerifyImages(imageA:, imageB:) — 1:1 face match
  • client.livenessCheckImage(File) — passive liveness, one frame
  • client.livenessCheckBurst(frames) — burst liveness, 3 to 5 frames
  • client.livenessCreateChallenge() and client.livenessCheckChallenge(frames, challengeToken:) — challenge liveness, 2 to 10 frames (3 or more for blink)

Generated sub-APIs for the JSON endpoints: client.sessions, client.face, client.ocr, client.liveness, client.diagnostics.

Widgets, exported from the same top-level import: EkycLivenessWidget for the server-verified liveness flow, EkycIdDocumentCapture, EkycCameraView and EkycBurstFaceVerifyWidget; see Custom UI primitives.