Quickstart
This guide takes you from zero to a working document scan in about five minutes. It uses the UX package, which gives you a complete camera scanning experience with the least amount of code.
The steps are the same on every platform:
- Get a license key.
- Add the SDK to your project.
- Launch the scanner and read the result.
Get a license key
- Go to the Microblink Developer Hub.
- Select BlinkID as the product.
- Select your platform.
- For web, set the domain to
localhostwhile testing, or the domain where your app is hosted.
Keep the key somewhere your app can read it, such as an environment variable. Never commit a production key to source control.
Add the SDK
Install the SDK and complete the platform-specific setup.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
- Flutter (Dart)
- React Native (TS)
Install the UX package:
npm install @microblink/blinkid
The scanning engine runs as a WASM module that must be served from your app, by default under /resources.
See Host resources for the copy step and the bundler setup, and the web README for the full integration.
The SDK is published on Maven Central.
Add the dependency to your module's build.gradle.kts:
dependencies {
implementation("com.microblink:blinkid-ux:8001.0.0")
}
See the Android README for repository configuration and the camera permission.
Add the SDK with Swift Package Manager, either through Xcode or in your Package.swift, and depend on the BlinkIDUX product:
dependencies: [
.package(
url: "https://github.com/BlinkID/blinkid-ios.git",
.upToNextMajor(from: "8001.0.0")
)
]
See the iOS README for the camera usage description requirement.
Add the dependency to your pubspec.yaml:
dependencies:
blinkid_flutter: ^8001.0.0
Then fetch the package:
flutter pub get
The plugin requires Flutter 3.44.1 or later, iOS 16.0 or later (enable Swift Package Manager with flutter config --enable-swift-package-manager), and Android minSdk 24 with compileSdk 36 and Kotlin 2.2.21.
See the Flutter README for the full setup.
Install the package:
npm install --save @microblink/blinkid-react-native
The package requires React Native 0.82 or later, iOS 16.0 or later, and Android API level 24 or later with compileSdk 36.
See the React Native README for the full setup.
Scan a document
Initialize the SDK with your license key and launch the scanner. When scanning finishes, you receive the extracted data in a callback.
- Web (TS)
- Android (Kotlin)
- iOS (Swift)
- Flutter (Dart)
- React Native (TS)
import { createBlinkId } from "@microblink/blinkid";
const blinkId = await createBlinkId({
licenseKey: import.meta.env.VITE_LICENSE_KEY,
});
blinkId.addOnResultCallback((result) => {
console.log("First name:", result.firstName?.latin?.value);
console.log("Document number:", result.documentNumber?.latin?.value);
void blinkId.destroy();
});
createBlinkId loads the engine, opens the camera, and mounts the scanning UI in one call.
Call destroy when you're done to release the camera and engine.
val sdk = BlinkIdSdk.initializeSdk(
context,
BlinkIdSdkSettings(licenseKey = "your-license-key")
).getOrThrow()
BlinkIdCameraScanningScreen(
blinkIdSdk = sdk,
onScanningSuccess = { result ->
println("First name: ${result.firstName?.value}")
println("Document number: ${result.documentNumber?.value}")
},
onScanningCanceled = { }
)
BlinkIdCameraScanningScreen is a composable that owns its own camera lifecycle, so no explicit cleanup is needed.
let sdk = try await BlinkIDSdk.createBlinkIDSdk(
withSettings: BlinkIDSdkSettings(licenseKey: "your-license-key")
)
let analyzer = try await BlinkIDAnalyzer(sdk: sdk)
BlinkIDUXView(
analyzer: analyzer,
onScanCompleted: { resultState in
guard let result = resultState.scanningResult else { return }
print("First name:", result.firstName?.value ?? "")
print("Document number:", result.documentNumber?.value ?? "")
}
)
BlinkIDUXView is a SwiftUI view that releases camera resources when it's dismissed, so no explicit cleanup is needed.
import 'dart:io';
import 'package:blinkid_flutter/blinkid_flutter.dart';
import 'package:flutter/services.dart';
final blinkIdPlugin = BlinkIdFlutter();
var sdkLicenseKey = '';
if (Platform.isAndroid) {
sdkLicenseKey = 'android-license-key';
} else if (Platform.isIOS) {
sdkLicenseKey = 'ios-license-key';
}
final sdkSettings = BlinkIdSdkSettings(licenseKey: sdkLicenseKey);
// Modules you leave out are disabled, so list every module you need.
final sessionSettings = BlinkIdSessionSettings(
scanningMode: ScanningMode.automatic,
scanningSettings: BlinkIdScanningSettings(
documentCaptureModule: DocumentCaptureModuleSettings(),
mrzModule: MrzModuleSettings(),
barcodeModule: BarcodeModuleSettings(),
vizModule: VizModuleSettings(),
),
);
try {
final result = await blinkIdPlugin.performScan(
blinkIdSdkSettings: sdkSettings,
blinkIdSessionSettings: sessionSettings,
);
print('First name: ${result?.firstName?.value}');
print('Document number: ${result?.documentNumber?.value}');
} on PlatformException catch (e) {
print('BlinkID scanning error: ${e.message}');
}
performScan launches the camera scanning experience and returns the result once scanning finishes.
If the user cancels scanning, performScan throws a PlatformException.
import { Platform } from 'react-native';
import { performScan } from '@microblink/blinkid-react-native';
const licenseKey = Platform.select({ ios: 'your-ios-key', android: 'your-android-key' })!;
try {
const result = await performScan({
sdkSettings: { licenseKey },
sessionSettings: {
scanningMode: 'automatic',
scanningSettings: { documentCaptureModule: {}, mrzModule: {}, barcodeModule: {}, vizModule: {} },
},
});
console.log('First name:', result.firstName?.value);
console.log('Document number:', result.documentNumber?.value);
} catch (error) {
console.log(`Error during scan: ${error}`);
}
performScan launches the camera scanning experience and returns the result once scanning finishes.
If the user cancels scanning, the promise is rejected.
That's a complete, runnable integration. Point the camera at an identity document and the extracted fields print to your console.
Read the result
The result is a structured object with a field for every piece of data BlinkID extracts: name, date of birth, document number, expiry date, address, and more. Each field also carries the location it was read from and the raw image.
For the full list of fields and their types, see the result reference.
On web, text fields expose values per script, so you read them as result.firstName?.latin?.value.
On Android, iOS, Flutter, and React Native, the same field is result.firstName?.value.
Next steps
- How the SDK works: the difference between the UX package and the core session.
- Scan from a static image: scan an uploaded or gallery image instead of the live camera.
- Extract specific fields: read only the fields you need.
- Customize the scanning UI: branding, instructions, and overlay.
- Restrict documents: limit scanning to specific document types or countries.