Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.smartcomply.com/llms.txt

Use this file to discover all available pages before exploring further.

SmartComply Flutter SDK

A powerful Flutter package for SmartComply identity verification and facial liveness detection. Our SDK delivers a drop-in UI that seamlessly orchestrates BVN/NIN verification (Nigeria), Document parsing (International), and video-based ML Kit facial liveness challenges.

Features

  • Drop-in UI Integrationsdk.open(context) launches our polished UI module natively on top of your app.
  • Dynamic Client Configuration — Fetches available document types securely from your SmartComply Dashboard rules.
  • One-Time Use Policy System — Verifications are securely bound utilizing a single-use parameter.
  • Identity Onboarding — Verifies BVN & NIN directly via national APIs, or scans Passports & National ID Cards.
  • Liveness Detection — Animated face action challenges (Blinking, Turning Head) backed by Google ML Kit.

Installation

In your app’s pubspec.yaml:
dependencies:
  smartcomply_sdk: ^0.1.0
Then run flutter pub get.

Platform Setup

Android

In android/app/src/main/AndroidManifest.xml, ensure your app has permission to access the camera:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
Set the minimum SDK version in android/app/build.gradle:
android {
    defaultConfig {
        minSdk 21
    }
}

iOS

In ios/Runner/Info.plist, declare the camera usage description:
<key>NSCameraUsageDescription</key>
<string>Camera is needed for liveness verification.</string>

The simplest way to integrate our SDK is to use the full wrapper widget. Upon launching, the SDK will automatically prompt the user for their Client ID.
import 'package:smartcomply_sdk/smartcomply_sdk.dart';

// 1. Create the SDK instance using your secret API Key
final sdk = SmartComply(
  const SDKConfig(
    apiKey: 'your_live_api_key',
    environment: Environment.production, // Use Environment.sandbox for testing
  )
);

// 2. Wrap the execution in an asynchronous callback
void startVerification(BuildContext context) async {
  try {
    // Open the SmartComply UI
    final result = await sdk.open(context);

    if (result.success) {
      print('Verification passed! Live Session Token: ${result.sessionToken}');
    } else {
      print('Failed or Canceled: ${result.errorMessage}');
    }
  } catch (e) {
    print("Fatal App Error processing SDK: $e");
  }
}
The SDK handles everything automatically:
  1. Shows an initial Client ID input screen.
  2. Identifies the user’s origin and prompts for ID types (BVN, NIN, Passport, etc).
  3. Requests camera permissions.
  4. Guides the user through liveness face capturing.
  5. Securely revokes the session to enforce single-use policy.

Advanced Usage (Headless Architecture)

If you are building your own UI from scratch instead of using our wrapper, you must capture the Client ID manually and trigger the endpoints yourself:
// 1. Manually initialize the session using a dynamic input UUID
final session = await sdk.createSession("user_provided_client_id");

// 2. Verify identity directly via backend API
final identity = await sdk.onboarding.verify(
  onboardingType: OnboardingType.bvn,
  idNumber: '22012345678',
);

// 3. Mount the Camera UI Liveness Checker Widget directly in your app tree
if (identity.isVerified) {
  final liveness = await sdk.liveness.startCheck(
    context,
    identifier: '22012345678',
    identifierType: 'bvn',
    country: 'nigeria',
    challengeActions: [ChallengeAction.blink, ChallengeAction.turnLeft],
  );
  print('Liveness: ${liveness.status}');
}

Supported Liveness Actions

Our engine can dynamically challenge users based on your Dashboard rules:
ActionEnum ValueDetection Method
BlinkChallengeAction.blinkML Kit eye open probability tracking
Turn leftChallengeAction.turnLeftML Kit headEulerAngleY analysis
Turn rightChallengeAction.turnRightML Kit headEulerAngleY analysis
Turn headChallengeAction.turnHeadML Kit headEulerAngleY analysis
Open mouthChallengeAction.openMouthML Kit classification