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

ValueDescription
ReturnDataMode.FullAll extracted data is returned, but images are excluded
ReturnDataMode.FullWithImagesAll extracted data is returned, including images of the scanned ID

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

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

ValueDescription
AnonymizationMode.NoneNo anonymization is applied (default)
AnonymizationMode.FieldsOnlyOnly fields (data) are anonymized
AnonymizationMode.ImagesOnlyOnly images are anonymized
AnonymizationMode.FieldsAndImagesBoth fields and images are anonymized

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

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:

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

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

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

Available Field Types

The IdFieldType enum defines the fields that can be anonymized:

ValueDescription
IdFieldType.FirstNameFirst name
IdFieldType.LastNameLast name
IdFieldType.FullNameFull name
IdFieldType.SexSex/gender
IdFieldType.NationalityNationality
IdFieldType.AddressAddress
IdFieldType.AdditionalAddressInformationAdditional address information
IdFieldType.AdditionalNameInformationAdditional name information
IdFieldType.AgeAge
IdFieldType.DateOfBirthDate of birth
IdFieldType.DateOfExpiryDate of expiry
IdFieldType.DateOfIssueDate of issue
IdFieldType.DocumentNumberDocument number
IdFieldType.DocumentAdditionalNumberDocument additional number
IdFieldType.PersonalIdNumberPersonal ID number
IdFieldType.IssuingAuthorityIssuing authority
IdFieldType.PlaceOfBirthPlace of birth
IdFieldType.ProfessionProfession
IdFieldType.EmployerEmployer
IdFieldType.MaritalStatusMarital status
IdFieldType.FathersNameFather's name
IdFieldType.MothersNameMother's name
IdFieldType.RaceRace
IdFieldType.ReligionReligion
IdFieldType.BloodTypeBlood type
IdFieldType.ResidentialStatusResidential status
IdFieldType.MrzOptionalDataInLine1MRZ optional data in line 1
IdFieldType.MrzOptionalDataInLine2MRZ optional data in line 2
IdFieldType.BarcodeDictionaryBarcode dictionary

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.