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 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. The READMEs cover everything beyond the snippet below: required versions, repository configuration, and camera permissions.
- 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:8000.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: "8000.0.0")
)
]
See the iOS README for the camera usage description requirement.
Add the dependency to your pubspec.yaml:
dependencies:
blinkid_flutter: ^8000.0.0
Then fetch the package:
flutter pub get
The plugin requires Flutter 3.44 or later, iOS 16.0 or later (enable Swift Package Manager with flutter config --enable-swift-package-manager), and Android minSdk 24 with Kotlin 2.1.20 or later.
Install the package:
npm install --save @microblink/blinkid-react-native
The package requires React Native 0.82.x, iOS 16.0 or later, and Android API level 24 or later.
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);
sdkSettings.downloadResources = true;
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,
);
if (result != null) {
print(result.firstName?.value);
}
} on PlatformException catch (e) {
print('BlinkID scanning error: ${e.message}');
}
performScan launches the camera scanning experience and returns the result once scanning finishes.
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, downloadResources: true },
sessionSettings: {
scanningMode: 'automatic',
scanningSettings: { documentCaptureModule: {}, mrzModule: {}, barcodeModule: {}, vizModule: {} },
},
});
console.log(result.firstName?.value);
} catch (error) {
console.log(`Error during scan: ${error}`);
}
performScan launches the camera scanning experience and returns the result once scanning finishes.
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 and iOS, 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.