Skip to main content
Speed up ID Bolt integration with Agent Skills

Install the official skill to help your coding agent (Claude Code, Codex, Cursor, etc.) integrate, debug, and customize ID Bolt following Scandit's recommended patterns. More info →

Run this in a terminal in your project directory, then follow the instructions to select your coding agent.

npx skills add https://github.com/scandit/skills --skill id-bolt

Your coding agent loads the skill automatically based on your prompt; to invoke it explicitly, call /id-bolt followed by your task.

Already installed? Update steps differ by agent — see how to keep your skills up to date.

Callbacks

ID Bolt provides callbacks to handle session completion and cancellation, allowing your application to respond appropriately to user actions and scan results.

Completion Callback

The onCompletion callback is invoked when the user has successfully scanned their ID and passed all validations. This is where you'll receive the extracted data.

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
onCompletion: (result) => {
if (result.capturedId) {
console.log("Document type:", result.capturedId.documentType);
console.log("Full name:", result.capturedId.fullName);
console.log("Document number:", result.capturedId.documentNumber);
// Process the scanned ID data
}
},
});

CompletionResult Object

The onCompletion callback receives a CompletionResult object containing:

PropertyTypeDescriptionSince
capturedIdCapturedIdThe scanned document data. Will be null if no data was returned based on the returnDataMode.1.0

Cancellation Callback

The onCancellation callback is invoked when the user closes the ID Bolt pop-up without completing the scanning process or when the service fails to start.

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
// other options...
onCancellation: (reason) => {
switch (reason) {
case CancellationReason.UserClosed:
console.log("User closed the scanning window");
// Handle user cancellation
break;
case CancellationReason.ServiceStartFailure:
console.log("ID Bolt service failed to start");
// Handle service failure
break;
}
},
});

CancellationReason Enum

The onCancellation callback receives a CancellationReason enum value:

ValueDescriptionSince
CancellationReason.UserClosedThe user closed the ID Bolt pop-up before completing the scanning process1.1
CancellationReason.ServiceStartFailureThe ID Bolt service failed to start1.1

Captured ID Data

The CapturedId object contains the extracted data from the scanned document. The available data depends on the document type and quality of the scan.

CapturedId Properties

PropertyTypeDescriptionSince
firstNamestringFirst name of the document holder1.0
lastNamestringLast name of the document holder1.0
fullNamestringFull name of the document holder1.0
sexstringSex/gender of the document holder1.0
nationalitystringNationality of the document holder1.0
addressstringAddress of the document holder1.0
issuingCountryRegionThe ISO (Alpha-3 code) abbreviation of the issuing country1.0
documentNumberstringUnique identifier assigned to the document1.0
documentAdditionalNumberstringSecondary identification number if present1.0
personalIdNumberstringPersonal identification number of the document holder1.3
dateOfBirthDateResultDate of birth of the document holder1.0
agenumberCalculated age based on date of birth1.0
dateOfExpiryDateResultExpiration date of the document1.0
isExpiredbooleanWhether the document is expired1.0
dateOfIssueDateResultDate when the document was issued1.0
documentTypeDocumentTypeType of document (e.g. "Passport", "IdCard", "DriverLicense", "VisaIcao", "ResidencePermit", "HealthInsuranceCard", "RegionSpecific")1.0
documentSubtypestring | nullSubtype of the document, if applicable2.1
capturedResultTypesstring[]Types of data that were captured1.0
nationalityISOstring | nullISO code of the nationality2.1
isCitizenPassportbooleanWhether the document is a citizen passport2.1
imagesobject | nullObject containing base64 encoded images (if requested)1.0
mrzResultMrzResult | nullRaw extracted data from Machine Readable Zone (MRZ)1.6
vizResultVizResult | nullRaw extracted data from Visual Inspection Zone (VIZ)1.11
barcodeResultBarcodeResult | nullRaw extracted data from barcode2.1
anonymizedFieldsIdFieldType[]List of fields that were anonymized for this document2.2

DateResult Object

Date values are represented as DateResult objects:

PropertyTypeDescriptionSince
daynumberDay of the month (1-31)1.0
monthnumberMonth (1-12)1.0
yearnumberFour-digit year1.0

Images Object

If you've used ReturnDataMode.FullWithImages, the images property will contain front and back image sets:

images: {
front: ImageSet;
back: ImageSet;
} | null

Each ImageSet contains:

PropertyTypeDescriptionSince
facestring | nullCropped face image extracted from the document (base64 encoded)2.0
croppedDocumentstring | nullCropped image of the document, only available when the visual inspection zone is scanned (base64 encoded)2.0
framestring | nullFull frame image of the captured document (base64 encoded)2.0

In version 1.x, images has a different structure:

PropertyTypeDescriptionSince
croppedstring[]Cropped images of the ID in the order they were captured (only available when VIZ is scanned)1.0
fullFramestring[]Full frame images in the order they were captured1.0

Raw Result Data

The mrzResult, vizResult, and barcodeResult properties on CapturedId expose the raw data extracted from the Machine Readable Zone (MRZ), the Visual Inspection Zone (VIZ), and the barcode respectively. Each is null when the corresponding zone was not scanned or contained no data. Which of these results is populated depends on the document type and which sides were captured.

All three result objects share a set of common fields, described below, and then add fields specific to their source.

Common Result Fields

The following fields are common to MrzResult, VizResult, and BarcodeResult:

PropertyTypeDescriptionSince
firstNamestring | nullFirst name of the document holder1.6
lastNamestring | nullLast name of the document holder1.6
fullNamestring | nullFull name of the document holder1.6
sexstring | nullSex/gender of the document holder1.6
nationalitystring | nullNationality of the document holder1.6
addressstring | nullAddress of the document holder1.6
documentNumberstring | nullUnique identifier assigned to the document1.6
dateOfBirthDateResult | nullDate of birth of the document holder1.6
dateOfExpiryDateResult | nullExpiration date of the document1.6
dateOfIssueDateResult | nullDate when the document was issued1.6

MrzResult Object

Raw data extracted from the Machine Readable Zone (MRZ). In addition to the common fields, it contains:

PropertyTypeDescriptionSince
capturedMrzstring | nullThe raw MRZ text as read from the document1.6
documentCodestring | nullDocument code from the MRZ1.6
fullNameSimplifiedChinesestring | nullFull name in simplified Chinese, when present1.6
issuingAuthorityCodestring | nullCode of the authority that issued the document1.6
namesAreTruncatedboolean | nullWhether the names in the MRZ were truncated1.6
omittedCharacterCountInGbkNamenumber | nullNumber of characters omitted from the GBK-encoded name1.6
omittedNameCountnumber | nullNumber of names omitted1.6
optionalDataInLine1string | nullOptional data contained in the first MRZ line1.6
optionalDataInLine2string | nullOptional data contained in the second MRZ line1.6
passportDateOfExpiryDateResult | nullExpiration date of the passport (for documents attached to one)1.6
passportIssuerIsostring | nullISO code of the passport issuer1.6
passportNumberstring | nullPassport number1.6
personalIdNumberstring | nullPersonal identification number of the document holder1.6
renewalTimesnumber | nullNumber of times the document has been renewed1.6

VizResult Object

Raw data extracted from the Visual Inspection Zone (VIZ). In addition to the common fields, it contains:

PropertyTypeDescriptionSince
additionalAddressInformationstring | nullAdditional address information1.11
additionalNameInformationstring | nullAdditional name information1.11
bloodTypestring | nullBlood type of the document holder1.11
capturedSidesstring | nullWhich sides of the document were captured1.11
documentAdditionalNumberstring | nullSecondary identification number if present1.11
drivingLicenseDetailsDrivingLicenseDetails | nullDriving license details, when applicable1.11
employerstring | nullEmployer of the document holder1.11
fathersNamestring | nullFather's name of the document holder1.11
isBackSideCaptureSupportedboolean | nullWhether the back side of the document supports capture1.11
issuingAuthoritystring | nullAuthority that issued the document1.11
issuingJurisdictionstring | nullJurisdiction that issued the document1.11
issuingJurisdictionIsostring | nullISO code of the issuing jurisdiction1.11
maritalStatusstring | nullMarital status of the document holder1.11
mothersNamestring | nullMother's name of the document holder1.11
passportNumberstring | nullPassport number1.11
personalIdNumberstring | nullPersonal identification number of the document holder1.11
placeOfBirthstring | nullPlace of birth of the document holder1.11
professionstring | nullProfession of the document holder1.11
racestring | nullRace of the document holder1.11
religionstring | nullReligion of the document holder1.11
residentialStatusstring | nullResidential status of the document holder1.11
sponsorstring | nullSponsor of the document holder1.11
usRealIdStatusstring | nullUS Real ID compliance status1.11
vehicleOwnerstring | nullVehicle owner information1.11
visaNumberstring | nullVisa number1.11
visaDetailsVisaDetails | nullVisa details, when applicable1.11

DrivingLicenseDetails Object

PropertyTypeDescriptionSince
drivingLicenseCategoriesDrivingLicenseCategory[]List of driving license categories1.11
restrictionsstring | nullDriving restrictions1.11
endorsementsstring | nullDriving endorsements1.11

DrivingLicenseCategory Object

PropertyTypeDescriptionSince
codestringCategory code1.11
dateOfIssueDateResult | nullDate the category was issued1.11
dateOfExpiryDateResult | nullDate the category expires1.11

VisaDetails Object

PropertyTypeDescriptionSince
fullNamestring | nullFull name on the visa1.11
applicationStatusstring | nullApplication status of the visa1.11
dateOfIssueDateResult | nullDate the visa was issued1.11
durationInDaysnumber | nullValidity duration in days1.11
geographicValiditystring | nullGeographic validity of the visa1.11
issuingCountryIsostring | nullISO code of the issuing country1.11
issuingAuthoritystring | nullAuthority that issued the visa1.11
multipleEntriesbooleanWhether the visa allows multiple entries1.11
numberOfEntriesnumber | nullNumber of allowed entries1.11
passportNumberstring | nullPassport number associated with the visa1.11
visaNumberstring | nullVisa number1.11
validFromDateResult | nullDate from which the visa is valid1.11
validUntilDateResult | nullDate until which the visa is valid1.11
visaTypestring | nullType of visa1.11

BarcodeResult Object

Raw data extracted from the barcode (for example, the PDF417 barcode on the back of US driver licenses). In addition to the common fields, it contains:

PropertyTypeDescriptionSince
aamvaVersionnumber | nullAAMVA specification version of the barcode2.1
aliasFamilyNamestring | nullAlias family name2.1
aliasGivenNamestring | nullAlias given name2.1
aliasSuffixNamestring | nullAlias suffix name2.1
barcodeDataElementsRecord<string, string>Raw barcode data elements keyed by element identifier2.1
barcodeMetadataBarcodeMetadata | nullMetadata about the barcode itself2.1
bloodTypestring | nullBlood type of the document holder2.1
branchOfServicestring | nullBranch of service (military documents)2.1
cardInstanceIdentifierstring | nullCard instance identifier2.1
cardRevisionDateDateResult | nullCard revision date2.1
categoriesstring[]Document categories2.1
champusEffectiveDateDateResult | nullCHAMPUS effective date2.1
champusExpiryDateDateResult | nullCHAMPUS expiry date2.1
citizenshipStatusstring | nullCitizenship status2.1
civilianHealthCareFlagCodestring | nullCivilian health care flag code2.1
civilianHealthCareFlagDescriptionstring | nullCivilian health care flag description2.1
commissaryFlagCodestring | nullCommissary flag code2.1
commissaryFlagDescriptionstring | nullCommissary flag description2.1
countryOfBirthstring | nullCountry of birth2.1
countryOfBirthIsostring | nullISO code of the country of birth2.1
deersDependentSuffixCodenumber | nullDEERS dependent suffix code2.1
deersDependentSuffixDescriptionstring | nullDEERS dependent suffix description2.1
directCareFlagCodestring | nullDirect care flag code2.1
directCareFlagDescriptionstring | nullDirect care flag description2.1
documentCopystring | nullDocument copy indicator2.1
documentDiscriminatorNumberstring | nullDocument discriminator number2.1
driverNamePrefixstring | nullDriver name prefix2.1
driverNameSuffixstring | nullDriver name suffix2.1
driverRestrictionCodesnumber[]Driver restriction codes2.1
ediPersonIdentifierstring | nullEDI person identifier2.1
endorsementsCodestring | nullEndorsements code2.1
exchangeFlagCodestring | nullExchange flag code2.1
exchangeFlagDescriptionstring | nullExchange flag description2.1
eyeColorstring | nullEye color of the document holder2.1
familySequenceNumbernumber | nullFamily sequence number2.1
firstNameTruncationstring | nullFirst name truncation indicator2.1
firstNameWithoutMiddleNamestring | nullFirst name without the middle name2.1
formNumberstring | nullForm number2.1
genevaConventionCategorystring | nullGeneva Convention category2.1
hairColorstring | nullHair color of the document holder2.1
heightCmnumber | nullHeight in centimeters2.1
heightInchnumber | nullHeight in inches2.1
iinstring | nullIssuer identification number2.1
identificationTypestring | nullIdentification type2.1
isRealIdboolean | nullWhether the document is a US Real ID2.1
issuingJurisdictionstring | nullJurisdiction that issued the document2.1
issuingJurisdictionIsostring | nullISO code of the issuing jurisdiction2.1
jpegDatastring | nullJPEG image data embedded in the barcode2.1
jurisdictionVersionnumber | nullJurisdiction version2.1
lastNameTruncationstring | nullLast name truncation indicator2.1
licenseCountryOfIssuestring | nullCountry of issue of the license2.1
middleNamestring | nullMiddle name of the document holder2.1
middleNameTruncationstring | nullMiddle name truncation indicator2.1
mwrFlagCodestring | nullMWR flag code2.1
mwrFlagDescriptionstring | nullMWR flag description2.1
payGradestring | nullPay grade2.1
payPlanCodestring | nullPay plan code2.1
payPlanGradeCodestring | nullPay plan grade code2.1
personDesignatorDocumentnumber | nullPerson designator document2.1
personDesignatorTypeCodestring | nullPerson designator type code2.1
personMiddleInitialstring | nullPerson middle initial2.1
personalIdNumberstring | nullPersonal identification number of the document holder2.1
personalIdNumberTypestring | nullType of personal identification number2.1
personnelCategoryCodestring | nullPersonnel category code2.1
personnelEntitlementConditionTypestring | nullPersonnel entitlement condition type2.1
placeOfBirthstring | nullPlace of birth of the document holder2.1
professionalDrivingPermitProfessionalDrivingPermit | nullProfessional driving permit details2.1
racestring | nullRace of the document holder2.1
rankstring | nullRank (military documents)2.1
relationshipCodestring | nullRelationship code2.1
relationshipDescriptionstring | nullRelationship description2.1
restrictionsCodestring | nullRestrictions code2.1
securityCodestring | nullSecurity code2.1
serviceCodestring | nullService code2.1
sponsorFlagstring | nullSponsor flag2.1
sponsorNamestring | nullSponsor name2.1
sponsorPersonDesignatorIdentifiernumber | nullSponsor person designator identifier2.1
statusCodestring | nullStatus code2.1
statusCodeDescriptionstring | nullStatus code description2.1
vehicleClassstring | nullVehicle class2.1
vehicleRestrictionsVehicleRestriction[]Vehicle restrictions2.1
versionstring | nullBarcode version2.1
weightKgnumber | nullWeight in kilograms2.1
weightLbsnumber | nullWeight in pounds2.1

BarcodeMetadata Object

PropertyTypeDescriptionSince
errorCorrectionnumber | nullBarcode error correction level2.1
moduleCountXnumber | nullNumber of barcode modules on the X axis2.1
moduleCountYnumber | nullNumber of barcode modules on the Y axis2.1

ProfessionalDrivingPermit Object

PropertyTypeDescriptionSince
codesstring[]Professional driving permit codes2.1
dateOfExpiryDateResult | nullExpiry date of the permit2.1

VehicleRestriction Object

PropertyTypeDescriptionSince
vehicleCodestringVehicle code2.1
vehicleRestrictionstringVehicle restriction2.1
dateOfIssueDateResult | nullDate the restriction was issued2.1

Example: Complete Callback Usage

const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
licenseKey: LICENSE_KEY,
documentSelection: DocumentSelection.create({
accepted: [new Passport(Region.Any)],
}),
returnDataMode: ReturnDataMode.FullWithImages,
onCompletion: (result) => {
if (result.capturedId) {
// Extract basic information
const { fullName, documentNumber, documentType, issuingCountry } = result.capturedId;
console.log("Full Name:", fullName);
console.log("Document Number:", documentNumber);
console.log("Document Type:", documentType);
console.log("Issuing Country:", issuingCountry);
}
},
onCancellation: (reason) => {
switch (reason) {
case CancellationReason.UserClosed: {
console.log("User cancelled the scanning process");
// Show alternative flow
return;
}
case CancellationReason.ServiceStartFailure: {
console.log("Service failed to start");
// Show alternative flow
return;
}
default: {
console.log("Other cancellation reason");
// Reserved for future cancellation reasons
}
}
},
});