Skip to main content

Data Handling

ID Bolt provides options to control what data is returned from scanned documents and how sensitive information is handled, allowing you to balance functionality with privacy requirements.

Return Data Mode

The returnDataMode option controls the extent of data returned by the onCompletion() callback:

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
returnDataMode: ReturnDataMode.Full,
});

Available Modes

ValueDescriptionSince
ReturnDataMode.FullAll extracted data is returned, but images are excluded1.0
ReturnDataMode.FullWithImagesAll extracted data is returned, including images of the scanned ID1.0

Choosing the Right Mode

  • Use ReturnDataMode.Full when you need the extracted data but don't require images
  • Use ReturnDataMode.FullWithImages when you need visual verification or need to store images for compliance purposes

When using FullWithImages, be aware that the response will be larger due to the base64-encoded image data.

Anonymization Mode

Available since version 1.3.

Some countries have specific requirements for the anonymization of documents. ID Bolt can be configured to protect sensitive fields and obscure them in result images:

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
anonymizationMode: AnonymizationMode.FieldsOnly,
});

Available Modes

ValueDescriptionSince
AnonymizationMode.NoneNo anonymization is applied (default)1.3
AnonymizationMode.FieldsOnlyOnly fields (data) are anonymized1.3
AnonymizationMode.ImagesOnlyOnly images are anonymized1.3
AnonymizationMode.FieldsAndImagesBoth fields and images are anonymized1.3

Effects of Anonymization

  • Fields Anonymization: Sensitive fields are not extracted from documents
  • Image Anonymization: Black boxes cover sensitive data in result images

When image anonymization is enabled (ImagesOnly or FieldsAndImages), and ReturnDataMode.FullWithImages is used, full-frame images will not be returned. Cropped images will still be available but with sensitive areas obscured.

Anonymized Fields

Available since version 2.2.

In addition to the anonymization mode, you can configure exactly which fields are anonymized using the anonymizedFields option. This gives you fine-grained control per document type.

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
anonymizationMode: AnonymizationMode.FieldsOnly,
anonymizedFields: {
defaultFields: true,
extraFields: [
{
document: new IdCard(Region.Any),
fields: [IdFieldType.DocumentNumber, IdFieldType.DateOfBirth],
},
],
},
});

Configuration

The anonymizedFields option accepts an object with two properties:

PropertyTypeDescriptionSince
defaultFieldsbooleanWhen true, the default set of sensitive fields is anonymized.2.2
extraFieldsAnonymizedFieldEntry[]Additional fields to anonymize for specific document types, on top of the defaults.2.2

Each AnonymizedFieldEntry specifies a document type and the fields to anonymize for that document:

PropertyTypeDescriptionSince
documentIdCaptureDocumentThe document type this entry applies to (e.g. new Passport(Region.Any), new IdCard("USA")).2.2
fieldsIdFieldType[]The fields to anonymize for this document type.2.2

Available Field Types

The IdFieldType enum defines the fields that can be anonymized:

ValueDescriptionSince
IdFieldType.FirstNameFirst name2.2
IdFieldType.LastNameLast name2.2
IdFieldType.FullNameFull name2.2
IdFieldType.SexSex/gender2.2
IdFieldType.NationalityNationality2.2
IdFieldType.AddressAddress2.2
IdFieldType.AdditionalAddressInformationAdditional address information2.2
IdFieldType.AdditionalNameInformationAdditional name information2.2
IdFieldType.AgeAge2.2
IdFieldType.DateOfBirthDate of birth2.2
IdFieldType.DateOfExpiryDate of expiry2.2
IdFieldType.DateOfIssueDate of issue2.2
IdFieldType.DocumentNumberDocument number2.2
IdFieldType.DocumentAdditionalNumberDocument additional number2.2
IdFieldType.PersonalIdNumberPersonal ID number2.2
IdFieldType.IssuingAuthorityIssuing authority2.2
IdFieldType.PlaceOfBirthPlace of birth2.2
IdFieldType.ProfessionProfession2.2
IdFieldType.EmployerEmployer2.2
IdFieldType.MaritalStatusMarital status2.2
IdFieldType.FathersNameFather's name2.2
IdFieldType.MothersNameMother's name2.2
IdFieldType.RaceRace2.2
IdFieldType.ReligionReligion2.2
IdFieldType.BloodTypeBlood type2.2
IdFieldType.ResidentialStatusResidential status2.2
IdFieldType.MrzOptionalDataInLine1MRZ optional data in line 12.2
IdFieldType.MrzOptionalDataInLine2MRZ optional data in line 22.2
IdFieldType.BarcodeDictionaryBarcode dictionary2.2

Result

The CapturedId object returned in the onCompletion callback includes an anonymizedFields property — an array of IdFieldType values indicating which fields were actually anonymized for the scanned document.