NEWSMRZ Scanner is now part of barKoder.What it means for you →

DOCUMENTATION

React Native

Cross-platform apps

Documentation / Cross-platform apps

On this page

Package: @mrzscanner/react-native, a TurboModule for the New Architecture.

Needs: React Native 0.76 or later, Android 7.0 (API 24) or later, iOS 15.1 or later.

Install

npm install @mrzscanner/react-native
cd ios && pod install

iOS: add a camera usage text to ios/<App>/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Scans the MRZ of passports and ID cards.</string>

Use

import { MRZScanner } from '@mrzscanner/react-native';

await MRZScanner.registerLicense('MRZ2...');      // once; without it some fields are masked

const result = await MRZScanner.scan({ documentTypes: ['passport', 'id'] });
if (result.status === 'read') {
  const read = result.reads[0];
  console.log(read.text, read.fields.document_number, read.checkDigitsValid);
}

const fromPhoto = await MRZScanner.scanImage({ path: photoUri });   // or { base64 }

scan(settings) opens the camera (asking for the permission). It closes after the first read or, with continuous: true, collects each new document until the user presses Stop. See Scan settings and Scan results. The types ship with the package.

Updated Oct 24, 2026 ยท Questions? Ask us