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

MRZ Scanner for NativeScript

A NativeScript plugin for Android and iOS, with its TypeScript types.

Package
@mrzscanner/nativescript
Requires
NativeScript 8+, Android 7+, iOS 15+
Version
2.5.0
Licensed by
App ID
NativeScripttypescript
import { MRZScanner } from '@mrzscanner/nativescript';

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: photoPath });   // or { base64 }

GET STARTED

Up and running in three steps

  1. 1npm install @mrzscanner/nativescript.
  2. 2Nothing to set for iOS: the plugin sets the deployment target (15.0) and a camera usage text; your Info.plist can give its own.
  3. 3Call MRZScanner.registerLicense once, then MRZScanner.scan() or MRZScanner.scanImage().
npm install @mrzscanner/nativescript
import { MRZScanner } from '@mrzscanner/nativescript';

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: photoPath });   // or { base64 }

What it does

  • A full-screen camera screen with AR mode: a box follows the MRZ and shows the read
  • Photos and files: scanImage reads the MRZ in a picture
  • Passports (TD3), ID cards (TD1, TD2) and machine readable visas
  • Single or continuous scanning, document types, region of interest, torch, zoom, a fast or careful confirmation
  • Optionally the MRZ alone as a straightened image, next to the text and parsed fields
  • The same three calls as every MRZ Scanner 2 plugin: registerLicense, scan and scanImage; types included

What it needs

  • NativeScript 8 or later (@nativescript/core 8+)
  • Android 7.0 (API 24) or later; iOS 15 or later
  • Works offline: recognition runs on the device; no image or document data is sent

LICENSING

Bound to your app IDs

A production licence for NativeScript is bound to the app IDs of your apps (bundle ID, package name), on any number of devices. One key covers every platform in your licence.

The same scanner on

Your key works on all of them.

Scan your first passport today

The trial key and the NativeScript SDK are in the portal.

Start a free trial