ID scanning for cross-platform apps built with ReactNative.
ID scanning for cross-platform apps built with ReactNative.
The BlinkID SDK is a comprehensive solution for implementing secure document scanning in React Native cross-platform applications. It offers powerful capabilities for capturing and analyzing a wide range of identification documents. The React Native plugin wraps the native BlinkID SDK and BlinkID UX modules, providing a complete, ready-to-use scanning experience with a user-friendly interface.
Please note that, for maximum performance and full access to all features, it’s best to go with one of our native SDKs (for iOS or Android).
However, since the wrapper is open source, you can add the features you need on your own.
Current version:
@microblink/[email protected](BlinkID SDK v8001).
If you are upgrading from v8000, see What's new in v8001.
If you are upgrading from v7.x, see Migrating from v7.x (then apply the v8001 notes).
A valid license key is required to initialize the BlinkID plugin.
A free trial license key can be requested after registering at the Microblink Developer Hub.
BlinkID React Native v8001 was built and tested with React Native v0.82.x
For additional help with React-Native setup, view the official documentation here.
Device requirements
The BlinkID React Native plugin requires:
For more detailed information about the BlinkID Android and iOS requirements, view the native SDK documentation here (Android & iOS).
The sample application demonstrates how the BlinkID plugin is implemented and shows how to configure scanning modules and obtain results.
It contains the implementation for:
The sample also includes a module settings panel where you can toggle and configure the document capture, barcode, MRZ, and VIZ modules, along with optional class filters and redaction settings.
To obtain and run the sample application, follow the steps below. Make sure you have Node & Watchman installed before running the sample application:
# install Watchman
brew install watchman
# install Node
brew install nodeTo install & run the sample application:
git clone https://github.com/microblink/blinkid-react-native.gitblinkid-react-native foldercd blinkid-react-nativeinitBlinkIdReactNativeSample.sh script to create a sample app, with required configurations applied../initBlinkIdReactNativeSample.shBlinkIdSample folder.Running the sample application on Android
npx react-native startnpx react-native run-androidAlternative: Run directly via Android Studio:
npx react-native startandroid folder via Android Studio in the BlinkIdSample folder to run the Android sample application.adb reverse tcp:8081 tcp:8081npx react-native startnpx react-native run-androidor open it in Android Studio and run it on the physical device from there.
Running the sample application on iOS
npx react-native startBlinkIdSample.xcworkspace located in the ios foldernpx @react-native-community/cli init YourAppName --package-name YourPackageName --title YourAppTitle --version "0.82.0"@microblink/blinkid-react-native dependency:npm install --save @microblink/[email protected]Add Maven Central to your project repositories.
In android/settings.gradle (or your root build.gradle, depending on your React Native version):
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}Ensure your app uses Kotlin v2.2.21 or newer, minSdkVersion 24 or newer, and compileSdkVersion 36 or newer. Use the Android Gradle Plugin and Gradle versions shipped with your React Native release (for example, React Native 0.82.x uses AGP 8.12 and Gradle 9.0).
blinkid-ux ships its Compose-based scanning UI as a precompiled AAR, so client apps do not need to enable the Compose compiler plugin, buildFeatures.compose, or a Compose BOM unless they compile their own Compose code.
Set the Kotlin version in your project-level android/build.gradle:
buildscript {
ext {
kotlinVersion = "2.2.21"
}
}The sample initialization script (initBlinkIdReactNativeSample.sh) contains the complete, tested Android configuration if you need a reference implementation.
ios/Podfile:platform :ios, '16.0'cd ios && pod installThe plugin ships with vendored BlinkID.xcframework and BlinkIDUX.xcframework frameworks.
Add the required usage descriptions to your app:
iOS — in Info.plist:
NSCameraUsageDescription
Camera access is required for document scanningIf you use DirectAPI with images from the photo library, also add:
NSPhotoLibraryUsageDescription
Photo library access is required for document image uploadAndroid — camera permission is typically merged from the BlinkID UX library. If needed, add to AndroidManifest.xml:
Note: The plugin usage process can be found in the sample app App.tsx file here.
After adding the blinkid-react-native dependency, import the API and set your platform-specific license key:
import { Platform } from 'react-native';
import {
performScan,
performDirectApiScan,
loadBlinkIdSdk,
unloadBlinkIdSdk,
refreshLicenseLease,
CountryID,
DocumentTypeID,
RegionID,
type BlinkIdScanningResult,
type BlinkIdSdkSettings,
type BlinkIdSessionSettings,
type BlinkIdScanningSettings,
type BlinkIdScanningUxSettings,
} from '@microblink/blinkid-react-native';
const licenseKey = Platform.select({
ios: 'your-ios-key',
android: 'your-android-key',
})!;All settings are plain objects. You do not need class constructors.
Use CountryID / RegionID / DocumentTypeID for class filters and redaction document filters. Nested Country / Region / DocumentType types ({ id?, rawValue }) appear only on scan results (documentClassInfo).
Scanning behavior is configured through BlinkIdScanningSettings, which contains up to four module settings. Include only the modules you want to use — omitting a module disables it.
…Module-only scanning examples:
barcodeModule, omit mrzModule and vizModule.documentCaptureModule.Note: When using PDF417 and QR barcode scanning, enable both
pdf417ScanningEnabledandqrScanningEnabledtogether. The analyzer treats them as a combined detection stage.
For DirectAPI with pre-cropped document images, set documentCaptureModule.cropType to "cropped" (or "unknown" if cropping is uncertain). Camera scanning (performScan) must keep cropType: "not-cropped".
Module configuration helpers can be found in ScanningModulesConfig.ts.
…DirectAPI extracts data from Base64-encoded static images instead of using the camera UI.
scanningMode: 'automatic' (front side first, back side second).scanningMode: 'single'.documentCaptureModule.cropType to "cropped" when images are already cropped and perspective-corrected, or "unknown" when cropping is uncertain. Use "not-cropped" for raw photos.…Anonymization was renamed to redaction in v8000. For camera scanning, use a RedactionSettingsResolver to apply per-document redaction rules. For DirectAPI, pass a single RedactionSettings object.
…Redaction modes: none, imageOnly, resultFieldsOnly, fullResult.
The BlinkID plugin implementation is located in the src folder here, while platform-specific implementation is located in the android and ios folders.
Currently, the BlinkID plugin contains two main scanning methods: performScan and performDirectApiScan.
The performScan method
Launches the BlinkID scanning process with the default UX.
Recommended call style — single settings object:
performScan({No open issues yet, or sync has not completed.