Skip to main content
Version: v8000

Extract specific fields

The top-level result object contains aggregated fields extracted from all scanned sides of the document. All fields are optional—the SDK only populates what it can read from the document. Always check whether a field is present before using its value.

On Web, string fields are typed as StringResult, a multi-alphabet object. Access the value for a specific script using the alphabet key: result.firstName?.latin?.value.

Name fields​

blinkId.addOnResultCallback((result) => {
console.log("First name:", result.firstName?.latin?.value);
console.log("Last name:", result.lastName?.latin?.value);
console.log("Full name:", result.fullName?.latin?.value);

void blinkId.destroy();
});

Date of birth​

Date fields carry both a structured representation (year, month, day) and the original string as it appeared on the document.

blinkId.addOnResultCallback((result) => {
const dob = result.dateOfBirth;
if (dob) {
console.log("Year:", dob.year);
console.log("Month:", dob.month);
console.log("Day:", dob.day);
console.log("Original string:", dob.originalString?.latin?.value);
}

void blinkId.destroy();
});

Document number and expiry​

blinkId.addOnResultCallback((result) => {
console.log("Document number:", result.documentNumber?.latin?.value);

const expiry = result.dateOfExpiry;
if (expiry) {
console.log("Expiry year:", expiry.year);
console.log("Expiry month:", expiry.month);
console.log("Expiry day:", expiry.day);
}

console.log("Permanent:", result.dateOfExpiryPermanent);

void blinkId.destroy();
});

Address​

blinkId.addOnResultCallback((result) => {
console.log("Address:", result.address?.latin?.value);
console.log("Additional address:", result.additionalAddressInformation?.latin?.value);

void blinkId.destroy();
});

Nationality and sex​

blinkId.addOnResultCallback((result) => {
console.log("Nationality:", result.nationality?.latin?.value);
console.log("Sex:", result.sex?.latin?.value);

void blinkId.destroy();
});

Document class info​

documentClassInfo identifies the type of document that was scanned—country, document type, and region. It is always present on the result.

blinkId.addOnResultCallback((result) => {
const classInfo = result.documentClassInfo;
console.log("Country:", classInfo.country);
console.log("Document type:", classInfo.documentType);
console.log("Region:", classInfo.region);

void blinkId.destroy();
});