Skip to main content

ID Bolt can be integrated into your existing application or website with minimal time and effort, often ready to test in your staging environment in just one hour.

ID Bolt is available as an npm package and can be installed using npm or yarn.

npm install @scandit/web-id-bolt

Once you have installed the package as a dependency, you can import the ID Bolt module and start scanning IDs.

note

A valid license key is required for ID Bolt. You can sign up for a free test account.

Your specific application needs and design define when the ID Bolt pop-up should opened. In this example, we open it after a click on a button present on the page:

import {
DocumentType,
DocumentSelection,
IdBoltSession,
Region,
RETURN_DATA_MODE,
Validators,
} from "@scandit/web-id-bolt";

const ID_BOLT_URL = "https://app.id-scanning.com";

const LICENSE_KEY = "-- YOUR LICENSE KEY HERE --";

async function startIdBolt() {
// define which documents are allowed to be scanned. More complex rules can be added.
const documentSelection = DocumentSelection.create({
include: [[Region.WorldWide, DocumentType.Passport]],
});
// initialization of the ID Bolt session
const idBoltSession = IdBoltSession.create(ID_BOLT_URL, {
licenseKey: LICENSE_KEY,
documentSelection,
// define what data you expect in the onCompletion listener (set below)
returnDataMode: RETURN_DATA_MODE.FULL,
// add validation rules on the scanned document
validation: [Validators.notExpired()],
locale: "en",
});
// open the pop-up
await idBoltSession.start();

// register some listeners:
idBoltSession.onCancellation = () => {
// the ID Bolt pop-up has been closed by the user without finishing the scan process.
};
idBoltSession.onCompletion = (result) => {
// the ID has been captured and validation was successful. In this example the result
// will contain the document data because `returnDataMode` was set to RETURN_DATA_MODE.FULL.
};
}

// open ID Bolt when some button is clicked
const someButton = document.getElementById("someButton") as HTMLButtonElement;
someButton.addEventListener("click", startIdBolt);

The above code snippet is a simple example of how to integrate ID Bolt into your application. It opens the ID Bolt pop-up when a button is clicked and listens for the completion of the scanning process.