Installation
You will receive an API key and a Client ID from SmartComply. Keep these secure and do not commit them to source control.
pubspec.yaml, replacing YOUR_TOKEN with the token provided to you:
Store the git token in an environment variable or a secrets manager — never hard-code it in
pubspec.yaml.How It Works
Create Session
Your app calls
createSession() using your apiKey and clientId. This returns a session token.Verify Identity
Your app calls
onboarding.verify() using the session token to confirm the user’s identity.Platform Setup
- Android
- iOS
In In
android/app/src/main/AndroidManifest.xml, add inside <manifest>:android/app/build.gradle (or build.gradle.kts):Initialisation
| Parameter | Required | Description |
|---|---|---|
apiKey | ✅ | API key issued by SmartComply. Used to authenticate session creation. |
clientId | ✅ | UUID of your SDK config record. Ties the session to your account settings. |
environment | Optional | Controls which SmartComply backend the SDK connects to: • Environment.production - Live system. Verifications use real databases and charge your account.• Environment.sandbox - Testing system. Uses mock data and does not charge your account.Defaults to sandbox. |
timeout | Optional | HTTP timeout. Defaults to 15 seconds. |
Step 1 — Create a Session
Must be called before any other SDK method. All subsequent calls automatically use the session token.
Step 2 — Verify Identity
OnboardingType | ID |
|---|---|
OnboardingType.bvn | Bank Verification Number |
OnboardingType.nin | National Identification Number |
Step 3 — Liveness Check
Opens the camera full-screen, guides the user through actions, captures a photo and video, and submits both to the backend:Supported Challenge Actions
ChallengeAction | API value sent | Detection method |
|---|---|---|
ChallengeAction.blink | BLINK | ML Kit eye open probability |
ChallengeAction.turnLeft | TURN_LEFT | ML Kit head euler Y angle |
ChallengeAction.turnRight | TURN_RIGHT | ML Kit head euler Y angle |
ChallengeAction.turnHead | TURN_HEAD | ML Kit head euler Y angle (either direction) |
ChallengeAction.openMouth | OPEN_MOUTH | Heuristic (confirmed by backend video AI) |
After
liveness/submit, the status will be "processing" while the backend AI analyses the video. The final passed or failed status is delivered via webhook to your webhook_url.