Mobile SDK

Verifa’s mobile SDKs provide native document capture, selfie collection, and liveness detection for iOS, Android, and React Native applications. The SDK handles the camera UI, image quality checks, and fraud signal collection with a native look and feel.

Platforms

PlatformPackageMin version
iOSVerifaSDK (Swift Package Manager)iOS 14+
Androidcom.verifa:sdk (Maven Central)API 24+ (Android 7.0)
React Native@verifa/react-native-sdkRN 0.72+

How it works

  1. Your server creates a session via the API
  2. Pass the session token to the mobile SDK
  3. The SDK presents native capture screens
  4. On completion, the SDK returns control to your app
  5. Your server receives the result via webhook

Integration flow

Step 1: Create a session (server-side)

$curl -X POST https://api.withverifa.com/api/v1/sessions \
> -H "X-API-Key: vk_live_your_key_here" \
> -H "Content-Type: application/json" \
> -d '{
> "external_ref": "user_abc123",
> "country": "US"
> }'

Pass the session id and token to your mobile app.

Step 2: Initialize the SDK

1import VerifaSDK
2
3let config = VerifaConfig(
4 sessionToken: "tok_abc123...",
5 environment: .production
6)
7
8let verifa = Verifa(config: config)
9
10verifa.start(from: self) { result in
11 switch result {
12 case .completed(let sessionId):
13 print("Verification completed: \(sessionId)")
14 case .cancelled:
15 print("User cancelled")
16 case .error(let error):
17 print("Error: \(error)")
18 }
19}

Step 3: Handle the result

The SDK callback tells you when capture is complete. The actual verification result comes via your server’s webhook:

1{
2 "event": "session.approved",
3 "data": {
4 "session_id": "session_abc123",
5 "external_ref": "user_abc123",
6 "status": "approved"
7 }
8}

Or poll from your server:

$curl https://api.withverifa.com/api/v1/sessions/session_abc123/result \
> -H "X-API-Key: vk_live_your_key_here"

SDK configuration

Fetch runtime config

The SDK fetches its configuration from the server on initialization:

GET /api/v1/sdk/config

This returns theming, feature flags, and required capture steps based on the session’s workflow.

Theming

Customize the SDK appearance to match your app:

1let config = VerifaConfig(
2 sessionToken: "tok_abc123...",
3 environment: .production,
4 theme: VerifaTheme(
5 primaryColor: UIColor(hex: "#4f46e5"),
6 backgroundColor: .white,
7 cornerRadius: 12
8 )
9)

Server-side theming is also available — configure in the dashboard under Settings > Organization (Theming section) and it applies to all SDK sessions.

Native fraud signals

The mobile SDK collects device-specific fraud signals not available in the web capture flow:

SignalDescription
Root/jailbreak detectionDetects rooted Android or jailbroken iOS devices
Emulator detectionIdentifies virtual devices and emulators
Debugger detectionDetects attached debuggers
Screen recordingDetects active screen capture or recording
Camera injectionDetects virtual camera apps injecting fake video
Device attestationValidates device integrity via platform APIs
Touch pressureAnalyzes touch pressure patterns (zero pressure = bot)
Gyroscope stabilityDetects unnaturally stable gyroscope (no hand movement)
Install sourceDetects sideloaded apps (not from official app store)

These signals are automatically submitted alongside the standard behavioral, device, and network signals.

Capture screens

The SDK presents these screens in sequence:

  1. Consent — Biometric processing consent
  2. Document type — Select ID type (passport, driver’s license, etc.)
  3. Document capture — Native camera with alignment guides, auto-capture, and quality feedback
  4. Selfie capture — Front-facing camera with face alignment
  5. Liveness challenge — Randomized challenges (blink, smile, head turn)
  6. Additional data — Email, phone, address (if required by workflow)

The SDK skips screens that aren’t required by the workflow’s data_requirements.

Permissions

The SDK requires camera permission. Request it before starting the SDK or let the SDK handle the system prompt:

PlatformPermission
iOSNSCameraUsageDescription in Info.plist
Androidandroid.permission.CAMERA in AndroidManifest.xml

Error handling

ErrorCauseResolution
token_expiredSession token TTL exceededResume the session for a new token
camera_unavailableNo camera or permission deniedPrompt user to grant camera access
network_errorLost connectivity during uploadSDK retries automatically
session_completedSession already finishedCreate a new session

Testing

In sandbox mode, the SDK allows you to select verification outcomes manually. Create sessions with a sandbox API key (vk_sandbox_*) to enable this.