Skip to main content
Version: v8001

Scan a single-sided document

By default, BlinkID uses an automatic scanning mode, which detects whether a document requires back-side scanning and prompts the user accordingly. Set the scanning mode to single when you only need data from one side—for example, when processing documents you know are single-sided, or when only the front-side data is relevant to your use case.

tip

If you're unsure whether a document has a scannable back side, keep the default automatic mode. It handles both single- and double-sided documents without any configuration.

Set the scanning mode​

Pass scanningMode: "single" when initializing the scanning session.

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

const blinkId = await createBlinkId({
licenseKey: "your-license-key",
scanningMode: "single",
});

blinkId.addOnResultCallback((result) => {
console.log("Result:", result);
void blinkId.destroy();
});

Read the result​

When scanning completes, the result contains the extracted data aggregated across all enabled modules. In single mode, subResults always has exactly one entry.

blinkId.addOnResultCallback((result) => {
// Aggregated result fields
console.log("First name:", result.firstName?.latin?.value);
console.log("Last name:", result.lastName?.latin?.value);
console.log("Date of birth:", result.dateOfBirth?.originalString?.latin?.value);
console.log("Document number:", result.documentNumber?.latin?.value);
console.log("Date of expiry:", result.dateOfExpiry?.originalString?.latin?.value);

// Per-side sub-result (single mode: always one entry)
const front = result.subResults[0];
console.log("MRZ:", front.mrz);
console.log("VIZ:", front.viz);

void blinkId.destroy();
});

For the full list of fields available on the result, see the API references for Web, Android, and iOS.