PLATFORMS << WEB

MRZ Scanner for WebAssembly early access

The scanner in the browser: camera or uploaded image, nothing leaves the device.

  • Packagemrz.js + mrz-core.wasm
  • RequiresModern browsers; about 1.1 MB gzipped
  • Version2.5.0

How it starts

  1. 1Serve mrz.js and mrz-core.wasm with your site.
  2. 2Load the scanner with MrzScanner.load() (in a Web Worker for the camera).
  3. 3Pass canvas ImageData to scanImage for a photo, or camera frames to scanFrame.

Install

The web SDK is in early access: ask us for it through a new issue in the portal. It is single-threaded and needs no special server headers: serve the files with your site.

Scan a document

WebAssemblyjavascript
import { MrzScanner } from './mrz.js';

const scanner = await MrzScanner.load();
scanner.registerLicense('MRZ2...');       // for this page's host name

const r = scanner.scanImage(imageData);   // canvas ImageData, or {data: RGBA bytes, width, height}
if (r && r.valid) console.log(r.text, r.fields);

scanner.scanFrame(frameImageData);        // camera frames: call on consecutive frames

Also available for