Passport Auto-Capture
The SDK finds the passport data page, the page with the photo and the machine-readable zone (MRZ), in the live camera feed, captures a sharp, flattened image and sends it to the Passport OCR API: 0.75 IC per page.
Call
- Flutter
- Web
- iOS
- Android
- React Native
import 'package:iapp_ekyc_sdk/iapp_ekyc_sdk.dart';
final client = IappEkycClient(apiKey: 'YOUR_API_KEY');
final result = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.passport,
locale: EkycLocale.en,
);
import { IappEkyc } from '@iapp-technology/ekyc-sdk';
const ekyc = new IappEkyc({ apiKey: 'YOUR_API_KEY' });
const result = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'passport',
locale: 'en',
});
// iOS (Swift; Objective-C also supported)
let config = IappEkycConfig(apiKey: "YOUR_API_KEY", flow: .documentCapture)
config.documentType = .passport
IappEkycSdk.present(from: self, config: config) { result in /* result.document?.rawJSON */ }
// Android (Kotlin; Java also supported)
ekyc.launch(IappEkycRequest.DocumentCapture(config, EkycDocumentType.PASSPORT))
// React Native
<IappEkycFlow flow="documentCapture" documentType="passport" apiKey="YOUR_API_KEY"
onResult={handleResult} onError={handleError} onCancel={close} />
Install: Getting started for Flutter and Web, iOS, Android & React Native for the native wrappers and camera permission.
Options
documentType:passport(DocumentType.passportin Flutter).locale: the on-screen language,en,thorzh(EkycLocale.enin Flutter).
Result
The result has typed fields plus the raw OCR response in result.raw (result.document?.rawJSON on iOS), including the parsed MRZ fields. Field list: Passport OCR API.
How auto-capture works
- Boundary: a four-sided shape in the on-screen guide matching the ID-3 passport data-page aspect ratio of 1.42 (125 × 88 mm), within ±0.25.
- Stability: the page must stay steady across recent frames, its corners drifting less than 2% of the frame diagonal.
- Sharpness: blurry frames are rejected before any credit is spent, which keeps the fine MRZ print free of motion blur.
- Perspective correction: the corners are warped to a flat page image of about 300 DPI (1476 × 1039 px) before upload.
- Manual fallback: a shutter button appears after 10 seconds if auto-capture has not fired.
The full algorithm specification is in the SDK source.