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

DOCUMENTATION

WebAssembly (early access)

Web

Documentation / Web

On this page

The scanner core compiled to WebAssembly. It runs in the visitor's browser, in a Web Worker: images and document data never leave the device.

Early access. The web SDK is not under Downloads yet. Ask us for it through a new issue in the portal.

Needs: a current browser with WebAssembly (Chrome, Edge, Firefox, Safari), and HTTPS for the camera (browsers require it). About 1.1 MB to download (gzipped). It is single-threaded and needs no special server headers.

Use

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

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

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

scanImage and scanFrame return null, or { text, lines, valid, fields, corners }: the MRZ text, its lines, whether the check digits match, the parsed fields (as in Scan results) and where the MRZ is.

The licence

On the web a licence is bound to your site's host name (for example checkin.example.com); registerLicense checks the key against the page's host name. It returns 0, or -2 invalid key, -3 other host, -5 expired, -6 not licensed for the web. Request a web licence under Licence requests with the Web platform.

Updated Oct 24, 2026 ยท Questions? Ask us