Skip to main content
Version: v8xxx

Scan barcodes

By default, BlinkID runs all four extraction modules.

To use BlinkID as a standalone barcode scanner, disable all the modules except barcodeModule.

When documentCaptureModule is disabled, additional barcode formats that are otherwise unavailable become enabled: UPC-E, UPC-A, Code 128, Code 39, EAN-8, EAN-13, ITF, Data Matrix, and Aztec.

note

pdf417ScanningEnabled and qrScanningEnabled must always be enabled or disabled together.

Configure the session​

Disable documentCaptureModule, mrzModule, and vizModule by setting each to null (web, Android) or nil (iOS). Leave barcodeModule enabled. On Flutter and React Native, modules you leave out of the scanning settings are disabled, so set only barcodeModule.

import { createBlinkId } from "@microblink/blinkid";

const blinkId = await createBlinkId({
licenseKey: "your-license-key",
scanningSettings: {
documentCaptureModule: null,
mrzModule: null,
vizModule: null,
},
});

Read the result​

The barcode result is available on the per-side sub-result. barcodeData contains the raw bytes and the decoded string. For driver's licenses and other AAMVA-compliant documents, the barcode data is also parsed into structured fields.

blinkId.addOnResultCallback((result) => {
const side = result.subResults[0];

// Raw barcode string
console.log("Barcode string:", side.barcode?.barcodeData.stringData);
console.log("Barcode type:", side.barcode?.barcodeData.barcodeType);
console.log("Parsed:", side.barcode?.parsed);

// Parsed fields (populated for AAMVA-compliant documents)
if (side.barcode?.parsed) {
console.log("First name:", side.barcode.firstName);
console.log("Last name:", side.barcode.lastName);
console.log("Date of birth:", side.barcode.dateOfBirth?.gregorian);
console.log("Document number:", side.barcode.documentNumber);
}

void blinkId.destroy();
});