# Scandit Developer Documentation > Developer Guides, API References, and Code Samples for building with Scandit Smart Data Capture. Scandit also publishes Agent Skills for coding agents (Claude Code, Codex, Cursor) - one per SDK, indexed at /llms-agent-skills.txt. This file contains all documentation content in a single document following the llmstxt.org standard. ## Configuring Input Data This guide explains how to configure input data for the **Custom Data Transfer** feature. Input data determines the type and format of the information to be collected by the user during scanning. ### Types of Input Data There are three types of input data you must configure: | Input Type | Description | |-------------------|-------------| | **Standard Input** | Predefined or fixed input fields configured in advance. | | **User Session Input** | Data provided by the user once at the beginning of a scanning session. | | **User Scan Input** | Data provided by the user for each scanned barcode. | ### Standard Input Standard inputs are fixed values or predefined fields. They are useful when you need to always attach the same kind of information (for example, device ID, operator ID). | Field | Description | |-------|-------------| | `type` | Always set to `standardInput` for this input type. | | `target` | Either of `picker`, `googleSheets`, or `share`. This defines where the data will be sent. Additional fields may be required depending on the target. | | `fields` | An array of **InputField** objects that define the data to be included. | #### Target | Target | Description | Additional Fields | |--------|-------------|-------------------| | `picker` | Data will be included in a CSV. | `format: 'csv'` | | `googleSheets` | Data will be sent to a Google Sheet. | `spreadSheetsId` (string) `sheetId` (Int) | | `share` | Data will be shared via Android's share functionality as a CSV file. | `format: 'csv'` | #### InputField | Field | Description | |-------|-------------| | `Type` | Defines the field type (`barcodeData`, `symbology`, `quantity`, `info`, `additionalInfo`, `generic`). | | `Key` | Identifier used for both display (label) and as the key in the output. | ### Example Configuration ```json { "type": "standard", "target": { "type": "googleSheets", "spreadSheetId": "My ID", "sheetId": 0 }, "fields": [ { "type": "barcodeData", "key": "name-of-barcode-column" }, { "type": "quantity", "key": "name-of-barcode-quantity" }, { "type": "generic", "key": "name-of-a-generic-column" } ] }, { "type": "userSession", "fields": [ { "type": "generic", "key": "STORE_NAME_1" }, { "type": "generic", "key": "STORE_NAME_2" } ] }, { "type": "userScanInput", "fields": [ { "type": "generic", "key": "SHELF_LOCATION" }, { "type": "quantity", "key": "QUANTITY_SCANNED" } ] } ``` --- ## Configuring Output Data This guide explains how to configure output data for the **Custom Data Transfer** feature. Output configuration determines how scanned data and additional inputs are structured, transformed, and exported to external systems. ### Core Configuration | Field | Description | |-------|-------------| | `type` | Always set to `standard` for this configuration type. | | `behavior` | Defines how new data is written. Options: - `replace`: overwrite existing data - `append`: add new rows or entries. | | `target` | Defines the destination for the output (for example, Google Sheets, CSV, API). | | `parserOptions` | (Optional) Array of parser configuration objects. | | `timestampOptions` | (Optional) Controls how timestamps are handled. | | `grouped` | Boolean (default: `true`). If `false`, the same barcode will be repeated when quantity > 1. | | `fields` | Array of **OutputField** objects that define which values should be exported. | ### OutputField Configuration Each `OutputField` defines a single column or output entry. | Field | Description | |-------|-------------| | `type` | Defines the source of the output value. Options: - `barcodeValue` - `inputValue` - `labelValue` | | `name` | String used as the column name in the output. | | `barcodeValue` | Configuration object (only if `type=barcodeValue`). Defines which aspect of the barcode to output. | | `inputValue` | String (only if `type=inputValue`). Refers to the key from an `InputField`. | | `labelValue` | String (only if `type=labelValue`). Refers to a label field name from `labelCaptureSettings`. | #### BarcodeValue Types When `type=barcodeValue`, the following `barcodeValue.type` options are available: | Type | Description | |------|-------------| | `barcodeData` | Raw scanned barcode data. | | `symbology` | Symbology type (for example, QR, Code128). | | `symbolCount` | Number of symbols in the barcode. | | `quantity` | Quantity derived from scanning. | | `timestamp` | Timestamp of the scan (see `timestampOptions`). | | `parsed` | Parsed values based on `parserOptions`. | | `found` | Whether the item was found (configurable labels: `foundValue`, `notFoundValue`). | | `counted` | Counting status (configurable: `notInListValue`, `notInListAcceptedValue`, `notInListRejectedValue`, `receivedValue`, `notReceivedValue`). | * `timestampOptions`: Default date format for all dates used is `"yyyy-MM-dd'T'HH:mm:ss'Z'"` (ISO 8601). You can customize this format using the `format` field. * `parserOptions`: Supported parsers are `hibc`, `gs1AI`, `swissQR`, `vin`, and `iataBcbp`. Use the `options` object if you want to put extra options to parsers. ### Example Configuration ```json { "type": "standard", "behavior": "append", "target": { "type": "googleSheets", "spreadSheetId": "My spreadSheetId", "sheetId": 0 }, "parserOptions": [ { "parserType": "gs1AI", "options": { "strictMode": false, "allowMachineReadableCodes": true } } ], "fields": [ { "type": "barcodeValue", "name": "Barcode", "barcodeValue": { "type": "barcodeData" } }, { "type": "barcodeValue", "name": "Quantity", "barcodeValue": { "type": "quantity" } }, { "type": "barcodeValue", "name": "Count Status", "barcodeValue": { "type": "counted", "notInListValue": "Item not in list", "notInListAcceptedValue": "Item not in list - but accepted", "notInListRejectedValue": "Item not in list - and rejected", "receivedValue": "Received", "notReceivedValue": "Not Received" } }, { "type": "barcodeValue", "name": "parsed field", "barcodeValue": { "type": "parsed", "parsedValues": [ { "parserType": "swissQR", "keys": "QRCH/AltPmtInf/AltPmt/2", "options": { "parserOptionKey1": true, "parserOptionKey2": false }, } ] } }, { "type": "inputValue", "name": "StoreName1", "inputValue": "STORE_NAME_1" }, { "type": "inputValue", "name": "StoreName2", "inputValue": "STORE_NAME_2" }, { "type": "barcodeValue", "name": "The First Barcode PD splitted", "labelValue": "pd", "barcodeValue": { "type": "parsed", "parsedValues": [ { "parserType": "gs1AI", "keys": "02.GTIN" } ] } }, { "type": "labelValue", "name": "The First Barcode PD", "labelValue": "pd" } ] } ``` --- ## Custom Data Transfer The **Custom Data Transfer** feature in Scandit Express lets you import and export data using a configurable CSV file or Google Sheet. By aligning data formats between Scandit Express and your system, this feature fits into your workflow without the need for coding or reformatting. ### Key Benefits Traditionally, data captured with Scandit Express could only be exported: - Automatically into a text field (via virtual keyboard). - To certain Android apps using a special sharing method. - Through standardized CSV reports. Standardized reports often use fixed field names that may not match your system’s database structure. This required manual reformatting before the data could be consolidated, slowing down workflows and creating friction. **Custom Data Transfer eliminates this step** by letting you configure both input and output formats to match your system’s data structure. - **No reformatting required**: Align captured data directly with your system’s fields. - **Flexible import and export**: Use Google Sheets, CSV files, or manual lists created in Scandit Express. - **Improved efficiency**: Reduce time spent on post-processing, so employees can focus on scanning tasks. - **System-agnostic**: Works with any system, including legacy systems, without the need for integration or custom development. ### How It Works 1. **Configure field mappings**; - Define which data fields are relevant for your capture flow. - Match these fields to the structure of your system’s database. 2. **Import data** into Scandit Express. - Upload a CSV file. - Connect to a Google Sheet. - Or create a new list directly within the app. 3. **Capture and update data** using Scandit Express. 4. **Export data** in your configured format, ready to be consumed by your system without additional formatting. ### Example Workflow - A product list is exported from your system in CSV format. - The CSV is imported into Scandit Express using the Custom Data Transfer feature. - Employees capture or update data during scanning tasks. - The updated data is exported back to CSV or Google Sheets in the same format—ready to be re-imported into your system without adjustments. --- ## Bluetooth Device Pairing ### Prerequisites Before you begin, ensure you have the following prerequisites: - The latest version of Xcode - An iOS project with a deployment target of iOS 14.0 or higher - A Scandit Express license key. Sign up for a [free trial](https://www.scandit.com/trial/) if you don't already have a license key. ### Installation **Swift Package Manager** To integrate the BLEScanner SDK into your Xcode project using Swift Package Manager, add the desired frameworks in the _Package Dependencies_ section of your project. Add our SPM package repository: ``` https://github.com/Scandit/blescanner-spm ``` Alternatively, if you prefer checking out git repositories via SSH: ``` git@github.com:Scandit/blescanner-spm.git ``` **CocoaPods** [CocoaPods](https://cocoapods.org/) is a dependency manager for Swift and Objective-C Cocoa projects. To integrate the BLEScanner SDK into your Xcode project using CocoaPods, specify it in your `Podfile`: ```ruby pod 'BLEScannerSDK' ``` **Add Manually** You can download the framework from: ``` https://ssl.scandit.com/sdk/download/scandit-blescannersdk-ios-${VERSION}.zip ``` replacing `${VERSION}` with the version you want to download. ### Configuring the Host To use the SDK in your source code, import it as follows: ```swift import BLEScannerSDK ``` You can then use the `WedgeHost` initializer to set up a host: ```swift WedgeHost( hostName: String, projectCode: String, baseUrl: String, eventCallback: (WedgeHostEvent) -> Void ) ``` - **hostName:** The name you specify for the host. - **projectCode:** Your Scandit Express project code provided in the dashboard. - **baseUrl:** The base URL for the QR code that will be generated. You can use this to directly open your app by specifying a universal link. For example, if you want your host to redirect users to Scandit Express, you can specify `https://express.scandit.com/bluetooth` or `scanditExpress://bluetooth`. - **eventCallback:** The callback for events sent to the host (more details below). The host can provide you with the **connection QR code** as a `UIImage` using: ```swift host.makeQRCode().generateQRCode() ``` #### Receiving Events Hosts receive events in the `eventCallback`. Here's how an event is defined: ```swift public struct WedgeHostEvent { public let eventType: BLEScannerSDK.WedgeHostEventType public let data: String? } ``` ```swift public enum WedgeHostEventType: Int { case NONE case ADV_STARTED // ADV stands for advertising Bluetooth services case ADV_STOPPED case ADV_ABORTED case DEVICE_NAME_SET case DEVICE_BARCODE_RECEIVED case DEVICE_DISCONNECTED } ``` For example, when the host successfully receives a barcode, the `WedgeHostEvent` will look like this: ```swift WedgeHostEvent(eventType: .DEVICE_BARCODE_RECEIVED, data: "barcode data") ``` ### Debugging the Host You will need to run the host on a physical device since Bluetooth functionality does not work on the simulator. --- ## Device Pairing **Device Pairing** in Scandit Express allows you to transfer scanned barcode data from one smart device (the sender) to another (the receiver) where your system application is running. This enables fast, flexible, and reliable data transfer between devices in real time—without needing to use additional hardware. Data can be transferred via Bluetooth for Native iOS apps and online connection for Web apps: - **Online Connection** - Works with web-based applications - Requires a stable internet connection - **Bluetooth** - Works with native iOS applications - No internet connection required ### Device Pairing Workflow Device Pairing connects two devices: - **Sender:** An iOS or Android device running Scandit Express to capture barcodes. - **Receiver:** A system device (iOS only) running a compatible app to receive data. 1. **Pairing** - On the receiver device, display a QR code (generated by your application through our SDK). - On the sender, open the native camera app and scan the QR code to pair the devices. 2. **Scanning** - Use the sender device to scan barcodes - Through the configuration you can choose to: - Automatically send each scan; or - Tap **“Send data to device”** to send all captured data at once 3. **Transfer** - Data is transmitted via Bluetooth or online connection - It is instantly entered into the target application on the receiver ### System Requirements * Sender Device * iOS or Android device running the Scandit Express app * Receiver Device - iOS (for Bluetooth) - Browser-based apps - Must support light integration with Scandit’s SDK ### Setup & Configuration - Scandit Express runs as a no-code scanning application on the sender device. - For Device Pairing to work, the **receiver application must integrate a lightweight SDK module** to enable data reception. :::note Apps that cannot be modified are **not supported** for pairing. ::: Only the receiving side needs code-level integration. Scandit Express remains a no-code scanning app. ### Try It Now [Online Connection Web Demo](https://barcode-link.demos.scandit.com/) --- ## Device Pairing for Web Apps ### Prerequisites - A valid **Scandit License Key** - Access to the **Scandit Express** app on the sender device (iOS or Android) - A web application (receiver) where scanned data will be received - Node.js and npm installed on your development machine ### Installation Install the SDK via npm: ```bash npm install @scandit/web-barcode-link ``` ### Implementation 1. Import the SDK ```javascript import { BarcodeLink, BarcodeLinkMode, BarcodeLinkSymbology, BarcodeLinkUiFlow } from '@scandit/web-barcode-link'; ``` 2. Create a BarcodeLink Instance ```javascript const barcodeLink = BarcodeLink.forLicenseKey('YOUR_SCANDIT_LICENSE_KEY'); ``` 3. Set the Barcode Link Mode ```javascript barcodeLink.setBarcodeLinkMode(BarcodeLinkMode.ContinuousScanning); ``` 4. Configure Symbologies (Optional) ```javascript barcodeLink.setSymbologies({ [BarcodeLinkSymbology.EAN13UPCA]: { enabled: true }, [BarcodeLinkSymbology.Code128]: { enabled: true }, [BarcodeLinkSymbology.QR]: { enabled: true } }); ``` 5. Add Event Listeners ```javascript barcodeLink.addListener({ onCapture: (barcodes, finished) => { barcodes.forEach((barcode) => { console.log('Scanned:', barcode.data); // Handle the scanned data here }); if (finished) { // The scanning session has ended } } }); ``` 6. Start the UI Flow ```javascript await barcodeLink.initialize(new BarcodeLinkUiFlow()); ``` ### Terminate the Session ```javascript barcodeLink.dispose(); ``` ### API Reference The `BarcodeLink` class is used to configure and initialize your Barcode Link instance. #### Creating an Instance ```ts const barcodeLink = BarcodeLink.forLicenseKey("-- ENTER YOUR SCANDIT LICENSE KEY HERE --"); ``` Use `forLicenseKey(licenseKey: string): BarcodeLink` to create a new `BarcodeLink` instance with your Scandit license key. #### Configuration Methods ##### `setBarcodeLinkMode(barcodeLinkMode: BarcodeLinkMode): BarcodeLink` ```ts barcodeLink.setBarcodeLinkMode(BarcodeLinkMode.ContinuousListBuilding); ``` Sets the Barcode Link mode. **Available values:** | Value | Description | |-------------------------|------------------------------------------------------------| | `SingleScanning` | (Default) Scan one barcode and close the session | | `ContinuousScanning` | Send barcodes in real-time and manually close the session | | `SingleListBuilding` | Send a list of barcodes and close the session | | `ContinuousListBuilding`| Send multiple lists and manually close the session | ##### `setListBehavior(listBehavior: BarcodeLinkListBehavior): BarcodeLink` ```ts barcodeLink.setListBehavior(BarcodeLinkListBehavior.Count); ``` Sets the behavior for how barcodes are listed. **Available values:** | Value | Description | |---------|-----------------------------------------------------| | `Unique`| (Default) Each barcode appears only once per list | | `Count` | Tracks how many times a barcode was scanned | :::note Only used in `SingleListBuilding` and `ContinuousListBuilding` modes. ::: ##### `setDisconnectionTimeout(disconnectionTimeout: number): BarcodeLink` ```ts barcodeLink.setDisconnectionTimeout(30 * 60 * 1000); ``` Sets how long Barcode Link keeps trying to reconnect after the desktop and the smartphone lose their connection to each other. If the connection is not restored within this window, the session is aborted on both devices. Added in `@scandit/web-barcode-link` 1.2.0. The value is in milliseconds. It defaults to 15 minutes (`900000`) and is clamped between 1 minute (`60000`) and 60 minutes (`3600000`). ##### `setPlatform(platform: BarcodeLinkPlatform): BarcodeLink` ```ts barcodeLink.setPlatform(BarcodeLinkPlatform.Web); ``` Sets the platform used for scanning. **Available values:** | Value | Description | |-----------|-----------------------------------------------------------| | `Express` | (Default) Launches the Scandit Express app | | `Web` | Opens a browser tab using the Scandit Web SDK | ##### `setBarcodeRegexValidation(barcodeRegexValidation: RegExp): BarcodeLink` ```ts barcodeLink.setBarcodeRegexValidation(/\d+/); ``` Defines a regex to validate barcodes. Only matching barcodes are processed. By default no validation is applied. :::warning Don't add flags such as `i`, `g` or `u` to the regex. Barcode Link removes only the first and last character of the regex, so `/abc/i` becomes the pattern `abc/` and valid barcodes no longer match. For case-insensitive matching, list both cases in the pattern, for example `/^[A-Za-z0-9]+$/`. Patterns that need the `u` flag, such as `\p{L}`, don't work. ::: ##### `setBarcodeTransformations(barcodeTransformations: unknown): BarcodeLink` ```ts barcodeLink.setBarcodeTransformations({ ... }); ``` Sets barcode transformation logic. Only used when `platform` is `BarcodeLinkPlatform.Express`. ##### `setSymbologies(symbologies: BarcodeLinkConfiguration['symbologies']): BarcodeLink` ```ts barcodeLink.setSymbologies({ [BarcodeLinkSymbology.EAN13UPCA]: { enabled: true, }, }); ``` Enables specific symbologies for scanning. Use the `BarcodeLinkSymbology` constants as keys. They hold the exact key strings Barcode Link expects, such as `ean13Upca`. **[See all supported symbologies](https://docs.scandit.com/barcode-symbologies/)** #### Event Listeners ##### `addListener(listener: BarcodeLinkListener): BarcodeLink` ```ts barcodeLink.addListener({ onCapture(barcodes) { console.log("Scanned:", barcodes); }, }); ``` Adds a listener for session events. **Available callbacks:** ###### `onCancel` ```ts barcodeLink.addListener({ onCancel() { console.log("Session closed."); }, }); ``` Called when the desktop closes the scanning session. Only available in `BarcodeLinkUiFlow`. ###### `onCapture` ```ts barcodeLink.addListener({ onCapture(barcodes: BarcodeLinkBarcode[], finished: boolean) { // Handle captured barcodes }, }); ``` Called when the remote device sends barcodes. - `finished`: `true` when the scanning session on the remote device has ended. Check it in every mode to know when to clean up. ###### `onConnectionStateChanged` ```ts barcodeLink.addListener({ onConnectionStateChanged(connectionState: BarcodeLinkConnectionState) { switch (connectionState) { // Handle state changes } }, }); ``` Tracks connection state changes. Only available in `BarcodeLinkHeadlessFlow`. **Available connection states:** | Value | Description | |-----------------------------|------------------------------------------------| | `MainDeviceDisconnected` | Desktop disconnected from session | | `MainDeviceReconnected` | Desktop reconnected to session | | `MainDeviceConnectionFailed`| Reconnection failed repeatedly | | `RemoteDeviceConnected` | Smartphone connected to session | | `RemoteDeviceDisconnected` | Smartphone disconnected from session | ##### `removeListener(listener: BarcodeLinkListener): BarcodeLink` ```ts barcodeLink.removeListener(myListener); ``` Removes a previously added listener. #### Initialization ##### `initialize(flow: BarcodeLinkFlow): Promise` ```ts await barcodeLink.initialize(new BarcodeLinkUiFlow()); ``` Initializes Barcode Link using a specific flow. **Flow types:** ###### `BarcodeLinkUiFlow` - Initializes with a pre-built UI. - Shows a QR code for smartphone connection. ###### `BarcodeLinkHeadlessFlow` - Initializes a headless session. - Requires custom UI. - Provides a QR code object for manual rendering. Example: ```ts import { BarcodeLinkHeadlessFlow } from "@scandit/web-barcode-link"; const qrcode = await barcodeLink.initialize(new BarcodeLinkHeadlessFlow()); const img = document.createElement("img"); img.src = qrcode.src; const a = document.createElement("a"); a.href = qrcode.href; a.append(img); document.body.append(a); ``` #### Disposing ##### `dispose(): void` ```ts barcodeLink.dispose(); ``` Closes the Barcode Link session, useful when unmounting components or ending a session manually. --- ## Find Items Powered by [MatrixScan Find](https://www.scandit.com/products/matrixscan-find/), a feature available in the Scandit Smart Data Capture SDK, this mode enables you to speed up finding and picking workflows by scanning multiple items at once and highlighting the correct items in real-time using an AR overlay. ### Create the Find List Using the Find mode in Scandit Express requires providing a list of barcodes to be found to the end-user. There are multiple ways to create this list, detailed below. #### Online Find List Generator We recommend that you start with creating a list with the barcodes to find (Find List) using our [Find List generator](https://express.scandit.com/find/list/generator/). Here is how it works: ![Find List Generator](/img/express/find-list-generator.png) #### Spreadsheet Find List You can also provide the Find List to your end-users as a spreadsheet. #### On Device A Find List can also be created on the device by scanning the barcodes to be found, for example by using a reference sheet. Select **Create List & Find** in the Scandit Express app and scan the barcodes to be found. The app will then create a Find List based on the scanned barcodes. ### Share the Find List Once the Find List is created, it can be shared with the end-users by either sharing a link (via text, Slack, email, etc.) or by integrating into your app. #### Share a Link You can also generate a URL in the format shown below and send it to the end-user. When the link is opened on the device, Scandit Express starts, the list of barcodes is shown and the user can start finding the barcodes with one click. The link to your Find List must be in the following format: ```http https://express.scandit.com/find/list?listName=&data= ``` Note the two query parameters that must be set in the URL: | Parameter | Description | | --- | --- | | `listName` | The name of the Find List. | | `data` | The list of barcodes to find, separated by commas. | Remember to use URL encoding for the list name and the list of barcodes: - For Excel, [ENCODEURL](https://support.microsoft.com/en-au/office/encodeurl-function-07c7fb90-7c60-4bff-8687-fac50fe33d0e) can be used. - For Google Sheets, [ENCODEURL](https://support.google.com/docs/answer/9199778?hl=en) can be used. - For JavaScript, [encodeURI()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI) can be used. - For Python, [urllib.parse.urlencode](https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode) can be used. #### Integrate into Your App You can also integrate the links for your Find Lists (with the barcodes to find embedded in them) in your own application. Follow the instructions above to create your list, and then display the link in your app or your website. If a user clicks on the link it will start Scandit Express and show the list of codes that need to be found. To integrate specific barcodes to find, you need to: 1. Generate a JSON string. We encode your barcode values into a JSON object as shown below. The JSON object is directly encoded as a string into a QR-code to create the “Find Code”. ```json { "type":"findList", "listName": "Pick list 230523", "part": 1, "partsTotal": 1, "data": ["050755164998737161267150050464","267904872997493075660232174005","003599442103692589922600168806","794304938682592584917910934794","067998913805565298544505960433","429412684815666169331665683721","629486918747410911816814820923","918501883962214718784809774935","771678071143373996836361503435","535726211992040548851819865224"] } ``` The space in QR codes is limited, so if you have more codes that can fit into a single QR code you can create multiple codes. A good rule of thumb is to limit to 2000 barcode characters for a single QR code. Adjust the “partsTotal” field (`"partsTotal": 2`) and number each code using the `"part"` field accordingly (`"part": 1` and `"part": 2`). 2. Generate a QR code from the JSON string and display it to the user. Take the JSON created and generate a QR code from it. As an example you can check the implementation in our [spreadsheet template](https://docs.google.com/spreadsheets/d/1Aj0lDEaS6Kh3-8rWlxPOdnuoYcpzXH5OH4SsmvGIyaE/edit#gid=1367552303) (look at the hidden fields in column D-K). You can then display the QR in your app or website. From Scandit Express, the user can scan the QR with **Load List & Find** and start finding the barcodes. --- ## ID Check The **ID Check** feature in Scandit Express enables scanning and verification of identity documents directly from the Scandit Express home screen. It is designed for use cases where verifying the **age** or **validity** of an ID is required, such as retail, hospitality, and regulated goods sales. This mode combines **ID validation**, **age verification**, and **export of scanned IDs** into a streamlined workflow that runs fully on-device. ### Getting Started From the Scandit Express **Home Screen**, select **ID Check** to launch the workflow. - The camera opens immediately in **ID Capture mode**. - Users scan the front of the ID document (back of document scanning is optional depending on configuration). - Validation and age verification checks are performed automatically. - A result screen confirms whether the ID passed or failed the configured checks. - The user can scan additional IDs or finish the session at any time. :::tip The camera stream pauses automatically after 30 seconds of inactivity to save battery. ::: ### Features - **ID Validation**: Detects whether an ID is valid, expired, or forged. - **Age Verification**: Compares the document’s date of birth against a configurable age limit. - **Configurable Document Types**: Supports a wide range of IDs (Driver Licenses, Passports, National IDs, Military IDs, etc.). See [Supported Documents](/id-documents.mdx). - **Persistence**: Optionally keep scanned IDs available across app sessions until cleared or exported. - **Export to CSV**: Scanned IDs can be exported as a CSV file with customizable columns. ### Configuration :::tip For configuration of the ID Check functionality, contact [Scandit Support](mailto:support@scandit.com). ::: ID Check is configured via the **Advanced** section of the Scandit Express settings. Configuration options include: | Configuration Key | Values | Behavior | |-----------------|-----------------|----------| | **enabled** | `true`, `false` | Whether ID Check is enabled and selected from the main menu or not. | | **idScanningMode** | `front and back`, `MRZ`, `PDF417`, `VIZ` | Specifies the scanning mode to use for ID documents and the areas of the documents to focus on. | | **supportedDocuments** | See [Supported Documents](/id-documents.mdx). | List of supported documents which can be scanned. By default all documents are enabled. | | **scanToFile** | See [Captured ID](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/captured-id.html) for a full list of all the possible fields. | | If this field is present it will be used to customize the output of this mode, i.e. `tableType` can be `custom` (choose which columns to export) or `full` (returns all fields). | | **enabledRejections** | See [ID Capture Settings](https://docs.scandit.com/data-capture-sdk/android/id-capture/api/id-capture-settings.html#property-scandit.datacapture.id.IdCaptureSettings.RejectedDocuments) for more information. | Specifies any documents that should be automatically rejected, for example enforcing age limits or regional restrictions. | | **scannedBarcodePersistenceEnabled** | `true`, `false` | If true, save scanned IDs when exiting the mode. Next time the user is shown a dialog asking whether to continue with persisted IDs or start fresh. Clear persisted data after every successful export or when the app is closed. | #### Example Configuration ```json "idCheck": { "enabled": true, "idScanningMode": "front and back" | "MRZ" | "PDF417" | "VIZ", // defaults to "front and back" "supportedDocuments": [ // list of supported documents, default to all documents { "type": "ID_CARD", "region": "ITALY" }, { "type": "DRIVER_LICENSE", "region": "TRINIDAD_AND_TOBAGO" } ... ], "scanToFile": { // if not specified, the default is the full export "format": "csv", // optional, default csv "tableType": "full", // optional, default full. Values: full, custom "timestampOptions": { // Default date format for all dates, optional "format": "yyyy-MM-dd'T'HH:mm:ss'Z'" // default value }, "enabledRejections": { // if not specified, the default is "rejectExpiredIds": true "rejectExpiredIds": true, "rejectHolderBelowAge": 21, "rejectForgedAamvaBarcodes": true, "rejectIdsExpiringIn": { "days": 2, "months": 3, "years": 0 } }, "scannedBarcodePersistenceEnabled": true // default is false } ``` --- ## Available Configurations There are many configuration options and functionalities available in Scandit Express. This section provides an overview of the different configuration options and how to set them up. ### Configuration Options #### Recognized Symbologies You can configure which [barcode symbologies](../../../barcode-symbologies) Scandit Express should recognize. By default, all symbologies are enabled. You can disable symbologies that are not needed to improve scanning performance. 1. Login to your [Scandit Dashboard](https://ssl.scandit.com/). 2. Click on the Project card you want to configure. 3. For each symbology, you can enable or disable it via the corresponding toggle. ![Symbology Configuration](/img/express/enabled_symbology.png) 4. [Reload the configuration](/hosted/express/getting-started/rollout.md#updating-configuration) in your app to apply the changes. If you want to further restrict what barcodes are accepted by Scandit Express, you can define a specific match as a regular expression. Only barcode data matching the specified regular expression will be accepted. The corresponding field is in the `barcodeRegexValidation` section. ![Barcode Regex Validation](/img/express/regex_validation.png) #### Keystroke Injection You can configure Scandit Express to inject additional keystrokes after a barcode is scanned. This is useful if you want to automate the process of entering data into a form or application. 1. Login to your [Scandit Dashboard](https://ssl.scandit.com/). 2. Click ont the Project card you want to configure. 3. Using the `appendKeyPress` section, you can define the keypresses that should be injected after a barcode is scanned. * `null` means no keypresses will be injected. * `enter` will inject an Enter keypress. * `\n` for Return Carriage. * `tab` for Tab. 4. [Reload the configuration](/hosted/express/getting-started/rollout.md#updating-configuration) in your app to apply the changes. #### Scanning Options Scandit Express has two scanning modes: Single and Batch. You can also turn on list building to collect your scans in a list. ##### Single Use Single mode to scan one barcode at a time. Point the camera at a barcode and Scandit Express scans it. If several barcodes are close together, choose the one you want. Single mode, also called Smart Scan Selection, is available from Scandit Express 4.3.0 on iOS and 4.4.0 on Android. It replaces the Accuracy and Speed modes of earlier versions. ##### Batch Use Batch mode to scan all visible barcodes at once, for example when you have many barcodes in view. To use Batch mode, you need a MatrixScan license and list building turned on. ![Batch Mode](/img/express/batch.gif) ##### List Building List building collects your scans in a list. You check the list, and then Scandit Express types the barcodes into the field. List building works in Single and Batch mode. It doesn't need a MatrixScan license, but Batch mode does. #### Activate via Hardware Button This feature is only supported for Android devices, and must be enabled by the Scandit Support team on your account. Contact us using this [webform](https://support.scandit.com/hc/en-us/requests/new) and include the following information: * Your Scandit account email address. * The project name you want to enable the feature for. * The device models you want to enable the feature for. * The key codes you want to use to trigger the barcode scanner. :::tip You can identify the key code with key code identifier apps available in the Play Store, such as [KeyEvent Display](https://play.google.com/store/apps/details?id=aws.apps.keyeventdisplay). ::: #### Parse and Sort Data Scandit Express gives you several options to parse the scanned data for such formats as: * Health Industry Barcodes (HIBC) * GS1 Application Identifiers * VIN Numbers * Swiss QR Codes You can parse and sort the scanned data either directly from Scandit Express, using the **Scan barcodes** tile in the **Scan and Export** section, or through keyboard injection. All scanning modes will return parsed data. Please contact [Scandit Support](mailto:support@scandit.com) if you would like to have parser capabilities enabled in your account and we will support you with the necessary details for your specific use case. --- ## Inventory Count Scandit Express an **Inventory Count** mode designed for fast, robust, and flexible item counting. This mode leverages **MatrixScan Count** and **SparkScan** to support real-world inventory, stock management, and audit scenarios. It can be launched directly from the home screen of Scandit Express. ![Express Menu](/img/express/express_menu.png) **Inventory Count** provides: - **Two scanning modes**: **MatrixScan Count** for batch scanning with progress tracking, and **SparkScan** for fast single-item scanning. - **Persistent scanned item list**: The scanned list remains available across sessions and workflows until explicitly cleared. - **List-based workflows**: Validate scanned items against a preloaded list of up to 120 barcodes. - **Flexible list loading**: Load lists via deep-link URLs or QR codes, including support for multiple QR codes for large lists. - **Duplicate handling**: Configure whether duplicates are allowed or restricted. - **Export to CSV**: Export results with full customization options. - **Status overlays**: Mark items as `Expired`, `Close to Expire`, or `Not Found`. - **Progress bar**: Shows scanning progress when working against a list. ### Getting Started On start, you will have two options: * **Count without List** which will allow you to start scanning products and then export a list of them. * **Load Order List** which allows you to load a predefined list of barcodes and then scan products to see if they are on the list. Lists can be loaded: - From a **deep-link URL** (for example, `https://express.scandit.com/count/list?listName=myList&data=123,456,789`) - From a **QR code** encoding the same URL - From **multiple QR codes** (for very large lists) ![Express Menu](/img/express/inventory_count.jpg) #### Scanning Modes There are two scanning modes available in Inventory Count, toggleable in the UI: - **MatrixScan Count**: Batch scanning with progress tracking. - **SparkScan**: Fast, single-item scanning. The scanned item list is **persistent across sessions and workflows**. Switching between modes or leaving the app does not clear it. :::tip If you need to customize the behavior of the Inventory Count feature, please contact [Scandit Support](mailto:support@scandit.com). ::: --- ## Scan Labels Powered by [Smart Label Capture](/sdks/android/label-capture/intro/), a feature available in the Scandit Smart Data Capture SDK, this mode enables the simultaneous scanning of multiple barcodes and printed text on labels, streamlining data entry and reducing errors. By combining barcode recognition with OCR and built-in intelligence, it can understand the context of the data and extract only the relevant fields for your application. It is available via the **Scan Labels** option in the Express menu. When finished scanning, you can export the list of scanned details. ![Express Menu](/img/express/express_menu.png) ### Configuration Label scanning can be enabled and configured in your [Scandit Dashboard](https://ssl.scandit.com/dashboard/) by navigating to the **Modes > Label Scanning** section: ![Label Scanning](/img/express/label-scanning.png) Once enabled, you can select from the following predefined label types, and the respective fields will be automatically detected when scanning: * **Smart Device Label**: Captures the UPC/EAN, IMEI1 and IMEI2, and Serial Number from mobile device labels. * **Price Label**: Captures the product barcode and the printed price from price labels. * **VIN Label**: Captures the Vehicle Identification Number (VIN) from vehicle labels. :::tip If you need to customize the behavior of the Smart Label Capture feature, please contact [Scandit Support](mailto:support@scandit.com). ::: --- ## Installation Follow the steps below to get started with Scandit Express. :::note To use Scandit Express, you need to have a Scandit account. If you don't have one, you can [sign up for a free trial](https://ssl.scandit.com/dashboard/sign-up?p=express-trial). ::: **iOS** 1. Sign up or Log in via the [Scandit Dashboard](https://ssl.scandit.com/) and select you project card. 2. Scan the QR code of the project using your smart device. You will be forwarded to the AppStore. 3. Install Scandit Express from there and your application will automatically be configured with the project of the scanned QR code. 4. Once installed, iOS will ask you to grant Scandit Express camera access. Camera access is required for barcode scanning. 5. Scandit Express will now be present whenever the keyboard is open. Click on the globe icon of the keyboard to switch between keyboards. **Android** 1. Sign up or Log in via the [Scandit Dashboard](https://ssl.scandit.com/) and select you project card. 2. Scan the QR code of the project using your smart device. You will be forwarded to the Play Store. 3. Install Scandit Express from there and your application will automatically be configured with the project of the scanned QR code. 4. Once installed, Android will ask you to grant Scandit Express camera access. Camera access is required for barcode scanning. 5. Scandit Express will now be present whenever the keyboard is open. Click on the globe icon of the keyboard to switch between keyboards. --- ## Production Rollout For production use, Scandit Express is typically distributed via a mobile device management (MDM) or enterprise mobility management (EMM) system. This page will guide you rolling out Scandit Express using such a system for either Android or iOS. This involves adding Scandit Express to your MDM/EMM solution's app catalog, and setting the project code to synchronize the Scandit Express configuration automatically to all devices. :::note The screenshots in this guide are from MobileIron Cloud. However, these instructions apply to MDM/EMM solutions from most vendors. ::: ### iOS You can distribute Scandit Express directly from the Apple App Store. Search for "Scandit Express" in the admin console of your EMM/MDM solution and add it to your app catalog. ![Add Express to App Catalog](/img/express/rollout_ios_1.png) #### Set the Project Code To automatically synchronize your Scandit Express configuration with Scandit, you need to set the project code in the management console of your MDM/EMM solution. Once set, your users won't have to manually activate Scandit Express via QR code. Configuration changes are also automatically distributed to all devices. 1. Login to your [Scandit Dashboard](https://ssl.scandit.com/). 2. Click on your project card. 3. From the Project dashboard, click the **Copy Project Code** link. 4. In your MDM system, paste this value in the **iOS Managed App Configuration** section. ![Add Project Code](/img/express/rollout_ios_2.png) :::note If your MDM system requires an AppConfig configuration, you can generate one [here](https://appconfig.jamfresearch.com/generator) by selecting Scandit Express as: `com.scandit.KeyboardWedge2/current`. ::: #### Third-Party Instructions {#3rd-party-instructions} This section provides links to the relevant sections of the documentation for popular MDM/EMM solutions: | Solution | Links | |:---------|:------| | MobileIron Cloud | [App Catalog](http://mi.extendedhelp.mobileiron.com/45/all/en/desktop/App_Catalog.htm), [App Configuration](http://mi.extendedhelp.mobileiron.com/45/all/en/desktop/App_Configuration.htm) | | VMWare Airwatch | [Add Public Applications from an App Store](https://docs.vmware.com/en/VMware-AirWatch/9.1/vmware-airwatch-guides-91/GUID-AW91-Config_Public_Apps_WS1.html) | ### Android Scandit Express for Android supports MDM/EMM deployment via [Android Managed Configurations](https://developer.android.com/work/managed-configurations). :::warning Please note that Scandit Express might not be compatible with some Android for Work configurations (for example, third-party keyboards such as Scandit Express can typically not be installed in a work profile). Scandit recommends setting Android devices as either ["fully managed"](https://support.google.com/work/android/answer/9562029?hl=en&ref_topic=9563482&sjid=2353681360583047853-EU) and ["dedicated devices"](https://support.google.com/work/android/answer/9560920?hl=en&ref_topic=9563482&sjid=2353681360583047853-EU). ::: You can distribute Scandit Express directly from the Google Play Store. Search for "Scandit Express" in the admin console for your EMM/MDM solution and add it to your app catalog. ![Add Express to App Catalog](/img/express/rollout_android_1.png) #### Set the Project Code To automatically synchronize your Scandit Express configuration with Scandit, you need to set the project code in the management console of your MDM/EMM solution. Once set, your users won't have to manually activate Scandit Express via QR code. Configuration changes are also automatically distributed to all devices. 1. Login to your [Scandit Dashboard](https://ssl.scandit.com/). 2. Click on your project card. 3. The Android Scandit Express App specifies the following Application Restriction: ```xml ``` 4. The `deploymentCode` value needs to be set by the admin of the Managed Configuration to the project code, which can be obtained on the Scandit Express Dashboard by clicking the **Copy Project Code** link. 5. In your MDM system, paste this value in the **Manage Configurations** section. ![Add Project Code](/img/express/rollout_android_2.png) #### Third-Party Instructions {#3rd-party-instructions-1} This section provides links to the relevant sections of the documentation for popular MDM/EMM solutions: | Solution | Links | |:---------|:------| | MobileIron Cloud | [App Catalog](http://mi.extendedhelp.mobileiron.com/45/all/en/desktop/App_Catalog.htm), [App Configuration](http://mi.extendedhelp.mobileiron.com/45/all/en/desktop/App_Configuration.htm) | | VMWare Airwatch | [Add Public Applications from an App Store](https://docs.vmware.com/en/VMware-AirWatch/9.1/vmware-airwatch-guides-91/GUID-AW91-Config_Public_Apps_WS1.html) | | IMB MaaS 360 | [Adding a Google Play App to the App Catalog](https://www.ibm.com/support/knowledgecenter/en/SS8H2S/com.ibm.mc.doc/pag_source/tasks/pag_apps_add_google_play.htm) | | SOTI MobiControl | [Adding an Google Play Store Application to an Application Catalog Rule](http://www.soti.net/mc/help/v13/en/Content/Web/Rules/Plus/Plus_Web_ApplicationCatalog.htm#Play_Store_Apps) | ### Updating Configuration To update the configuration of Scandit Express on all devices, change the configuration in the Scandit Dashboard. The new configuration will be automatically distributed to all devices. Scandit Express automatically updates the license and configuration when restarted, but if you need to force a reload: 1. Open the user menu in the top right corner of the Scandit Express app. ![Open User Menu](/img/express/user_menu.png) 2. Tap on **Refresh Project**. ![Refresh Project](/img/express/refresh_project.png) --- ## Safari Browser Extension The **Safari Browser Extension** is an alternative to the Scandit Express Keyboard. It allows barcode data to be scanned and injected directly into web applications running inside Safari on iOS devices. Instead of typing from the Express Keyboard, users can trigger the scanner via a button next to text fields in a webpage. This is especially useful for workflows where scanning should be initiated directly from the application interface. ### Installation The Safari Browser Extension is bundled with the **Scandit Express** app as an extension (`.appex`). - When the Scandit Express app is installed, the Safari extension is also installed but must be enabled by the user. By default, Safari will ask for permission to run the extension on websites and users can choose: - **Allow Once** - **Always Allow** - **Deny** Once enabled, the extension is visible in the Safari toolbar. :::tip Both the extension icon and the pop-up UI can be customized. ::: ### How It Works When enabled, the extension automatically adds a **Scan** button next to input fields in Safari webpages. 1. The user taps the **Scan** button next to a text field. 2. Safari opens a deep link to the Scandit Express app. 3. The Express scanner is launched, and the scanned barcode is stored in shared storage. 4. Safari is brought back into focus. 5. The extension retrieves the scan result and inserts it into the selected input field. ### Configuration The Safari extension can be configured via the Scandit Dashboard from the **General > Browser Extension** section. ![Safari Extension Dashboard](/img/express/browser-extension.png) #### Default Behavior By default, the extension attaches a scan button next to every `` field on the page. #### Restricting Buttons to Specific Fields Developers can limit the scan button to appear only for specific fields by providing CSS selectors. --- ## Scandit Express Scandit Express is an application that enables you to instantly add barcode scanning to any existing app or software tool on a smart device. It requires no software changes or coding effort, and is compatible with any app or system, even those that cannot be modified. By adding a keyboard that has a scan button above the standard keys (a keyboard wedge), it allows users to scan barcodes directly into any input field. Scandit Express is built for enterprise use and supports distribution through mobile device management (MDM) and enterprise mobility management (EMM) systems. ### Minimum Requirements | Platform | Minimum Version | Camera | |----------|------------------|--------| | Android | 9.0 | 720p, Autofocus and fixed-focus | | iOS | 12.0 | 720p, Autofocus and fixed-focus | ### UI/UX The Scandit Express user interface (UI) is designed to resemble a smartphone camera. It also includes features to reduce user workload and frustration, such as aiming assist, batch scanning, and visual, sound, and haptic feedback. There is also an advanced _Find_ mode that helps frontline workers and customers instantly locate items using an augmented-reality (AR) interface. ![Scandit Express](/img/express/express_ui.png) You can scan barcodes one at a time or all at once, and collect your scans in a list to check them before they go into the field. #### Scanning Modes Scandit Express offers two scanning modes: * **Single**: Point the camera at a barcode to scan it. If several barcodes are close together, choose the one you want. Single mode, also called Smart Scan Selection, is available from Scandit Express 4.3.0 on iOS and 4.4.0 on Android. It replaces the earlier Accuracy and Speed modes. * **Batch**: Scan all visible barcodes at once. To use Batch mode, you need a MatrixScan license and list building turned on. With list building, your scans go into a list. You check the list, and then Scandit Express types the barcodes into the field. List building works in both modes. It doesn't need a MatrixScan license, but Batch mode does. ### Security and Compliance Scandit Express follows the same [security and compliance standards](https://www.scandit.com/company/security/) as all other Scandit products. Your data belongs to you, and we will never collect it unless authorized by you. No keystrokes are recorded, no images captured for barcode decoding are stored on the device after the scan is complete, and no images are transmitted. Scandit Express is fully functional without network access. * Devices register with Scandit’s servers to track the total number of devices on which Scandit Express is used. * No personally identifiable information stored on the device (such as name, phone number, email address, or device ID) is ever processed or transmitted by Scandit Express. * All communication is encrypted. * No connectivity into your network and no access to your IT system is required. --- ## Configuring the Markdown Workflow Configure the Markdown workflow in the Scandit Express dashboard to help users efficiently manage tasks related to product recalls. The configuration can only be done via the Code Editor in the **Advanced** section of the dashboard: ![Code Editor](/img/express/code-editor.png) ### Configuration Options The Markdown workflow can be configured using the following options: | Option | Description | Example Value | |----------------------|---------------------------------------------------------------------------------------------------|------------------------------| | `type` | The type of workflow. This should always be set to `markdown`. | `markdown` | | `labelCaptureSettings` | Settings for label capture, including the fields to capture and their validation rules. | JSON, see example below | | `daysUntilExpiry` | Integer value representing the number of days until the item expires. | `3` | | `expiryDateField` | Object that contains name and other properties for the item. | `ExpiryDateField` | Each `expiryDateField` object must include the following properties: - `name`: The name of the field to capture (This should find a match the `labelCaptureSettings.labelDefinitions.fields[i].name`). - `expiredValue`: Message to be shown when item is expired. - `actionNeededValue`: Message to be shown when item is going to expire. - `noActionNeededValue`: Message to be shown when item is not close to expiry. #### Example Configuration ```json { "integration": { "integrations": [ { "name": "Markdown", "scenario": { "type": "markdown", "labelCaptureSettings": { "labelDefinitions": [ { "caching": true, "fields": [ { "fieldType": "customBarcode", "name": "Barcode", "patterns": [ "^2.*", "^02.*" ], "symbologies": [ "ean13Upca", "code128", "code39", "interleavedTwoOfFive", "ean8", "upce" ] }, { "fieldType": "expiryDateText", "name": "Expiry Date", "labelDateFormat": { "componentFormat": "MDY" } } ], "name": "text_semantics_label" } ] }, "daysUntilExpiry": 3, "expiryDateField": { "name": "Expiry Date", "expiredValue": "Remove from shelf!\nItem EXPIRED", "actionNeededValue": "50% off", "noActionNeededValue": "No action needed" } }, "inputs": [], "outputs": [] } ] } } ``` --- ## Built-in Workflows Scandit Express’s built-in workflows are configurable, ready-to-deploy modes designed to accomplish a specific task. They provide actionable insights to the user through prompts or AR-guidance. There are four built-in workflows available in Scandit Express: ### Task Management Task Management is a workflow designed to help users efficiently manage tasks related to product recalls. It provides a streamlined process for capturing and acting on important product information. The user enters the recalled lot number(s) into Scandit Express. They then scan the item's barcode, lot number, and (optionally) the expiry date. Scandit Express analyzes the data and displays an on-screen prompt with the appropriate next steps. See [Task Management Configuration](./task-management.md) for details on how to configure this workflow. ### Markdown The Markdown workflow in Scandit Express is designed to streamline the process of marking down fresh items approaching their expiry dates. This workflow allows users to quickly and accurately capture the necessary information, reducing the time spent on manual checks. No integration is required — the markdown logic can be configured directly in the Scandit Express dashboard. Once set up, users hover the camera over an item’s barcode and expiry date and Scandit Express captures and interprets the data based on the configured logic. An AR overlay is then displayed, guiding the user on the appropriate action to take. See [Markdown Configuration](./markdown.md) for details on how to configure this workflow. ### Track and Trace Track and Trace is a workflow designed to enhance the visibility and management of pharmaceutical products throughout the supply chain. This workflow allows users to complete two workflows at once by verifying drug expiration with AR overlays while receiving or taking stock. Expired items are highlighted with a distinctive AR overlay and enable users to take immediate action. :::warning This workflow only works for items which have the expiry date encoded in the barcode. ::: ### Age Check Scandit Express's Age Check workflow allows users to verify age and ID authenticity. This helps ensure compliance with age-restricted regulations, such as alcohol sales or vehicle rentals, using Scandit's powerful ID Scanning and Validation technology. Users can scan the front and/or back of IDs, and they receive immediate feedback including verification of authenticity, expiry, and age. All scanned IDs can be exported at the end if needed. --- ## Configuring the Task Management Workflow Configure the Task Management workflow in the Scandit Express dashboard to help users efficiently manage tasks related to product recalls. The configuration can only be done via the Code Editor in the **Advanced** section of the dashboard: ![Code Editor](/img/express/code-editor.png) ### Configuration Options The Task Management workflow can be configured using the following options: | Option | Description | Example Value | |----------------------|---------------------------------------------------------------------------------------------------|------------------------------| | `type` | The type of workflow. This should always be set to `taskManagement`. | `taskManagement` | | `labelCaptureSettings` | Settings for label capture, including the fields to capture and their validation rules. | JSON, see example below | | `taskGenericKeys` | An array of generic keys that can be used in task prompts. | `["key1", "key2"]` | | `taskField` | The field you want to consider for taking decisions about leaving on the shelf or not. | `taskField` | Each `taskField` object must include the following properties: - `name`: The name of the field to capture (This should find a match the `labelCaptureSettings.labelDefinitions.fields[i].name`). - `inListValue`: String to be shown if the scanned label is in the expected list. - `notInListValue`: String to be shown if the scanned label is not in the expected list. ### Example Configuration ```json { "integration": { "integrations": [ { "name": "TaskManagement", "scenario": { "type": "taskManagement", "labelCaptureSettings": { "labelDefinitions": [ { "caching": true, "fields": [ { "fieldType": "customBarcode", "name": "Barcode", "symbologies": [ "ean13Upca", "code128", "code39", "interleavedTwoOfFive", "ean8", "upce" ] }, { "fieldType": "unitPriceText", "name": "Unit Price", "optional": true }, { "fieldType": "weightText", "name": "Weight", "optional": true }, { "fieldType": "totalPriceText", "name": "Total Price", "optional": true }, { "fieldType": "packingDateText", "name": "Packing Date", "optional": true }, { "fieldType": "expiryDateText", "name": "Expiry Date", "optional": true }, { "fieldType": "customText", "name": "Lot Number", "anchorRegexes": [ "Lot" ], "valueRegexes": [ "\\d{5,15}" ], "optional": true } ], "name": "text_semantics_label" } ] }, "taskGenericKeys": ["Column", "Column2", "Column3"], "taskField": { "name": "Lot Number", "inListValue": "Recalled Item!\nRemove from shelf!", "notInListValue": "Keep item on shelf" } }, "inputs": [ { "type": "userSession", "fields": [ { "type": "generic", "key": "Column" }, { "type": "generic", "key": "Column2" } ] }, { "type": "standard", "target": { "type": "googleSheets", "spreadSheetId": "10ewpiR5wWkBUGCvf5YooiZcrkh74VUQivEB3l3RU3jk", "sheetId": 640733273 }, "fields": [ { "type": "generic", "key": "Column3" } ] } ], "outputs": [] } ] } } ``` --- ## Advanced Options This page covers advanced features and options for ID Bolt that help optimize performance and handle specific use cases. ### Keep Alive Available since version `1.6`. When running ID Bolt multiple times in sequence (such as scanning multiple passports in a batch), you can improve performance by keeping resources alive between sessions: ```ts // first scan let idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... keepAliveForNextSession: true, }); // second scan idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... keepAliveForNextSession: true, }); // more scans... // When finished with all scans IdBoltSession.terminate(); ``` #### Benefits - Faster loading times for subsequent scans - No need to request camera permissions again - Reduced resource initialization overhead #### Important Notes - Always call `IdBoltSession.terminate()` when done with all scans to release resources - This feature is most beneficial when scanning multiple IDs in quick succession ### Browser Navigation Control Available since version `1.14`. By default, ID Bolt closes when users press the browser's back button. You can disable this behavior: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... disableCloseOnBrowserBack: true, }); ``` #### When to Use - When you have custom navigation logic in your application, that interferes with this feature #### Default Behavior When `disableCloseOnBrowserBack` is `false` (default), pressing the back button closes the ID Bolt pop-up and triggers the `onCancellation` callback with `CancellationReason.UserClosed`. ### Transaction Tracking Available since version `1.17`. You can associate ID Bolt sessions with your internal tracking identifiers for analytics and debugging: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... externalTransactionId: "booking-12345", // your booking, order, or transaction ID }); ``` #### Benefits - Correlate ID Bolt sessions with your business transactions - Better analytics and reporting capabilities #### Example Use Cases - E-commerce: Order IDs - Booking systems: Reservation Numbers --- ## API Overview ## ID Bolt API Overview ID Bolt is built around the concept of a **session** - a complete user journey from starting the ID scanning process to either successful completion or cancellation. The main class `IdBoltSession` represents this session and manages the entire workflow. ### Quick Start Example ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { licenseKey: LICENSE_KEY, documentSelection: DocumentSelection.create({ accepted: [new Passport(Region.Any)], }), returnDataMode: ReturnDataMode.Full, validation: [Validators.notExpired()], onCompletion: (result) => { console.log("Successfully completed workflow", result); }, onCancellation: (reason) => { console.log("Scanning cancelled", reason); }, }); await idBoltSession.start(); ``` ### Session Methods #### Creating a Session ```ts IdBoltSession.create(serviceUrl: string, options: IdBoltCreateSessionOptions): IdBoltSession ``` Creates a new ID Bolt session with your configuration. The session is not started until you call `start()`. **Parameters:** - `serviceUrl`: Your ID Bolt service URL from the Scandit dashboard - `options`: [Configuration object defining the session behavior](#configuration-options) :::note The default value `app.id-scanning.com` is an alias that points to Scandit's servers. In a production environment it can be changed to your own domain name pointing to Scandit's servers. This will require you to configure a CNAME record in the DNS settings of your domain. Contact your Scandit account manager for more information. ::: #### Creating a Session from a Launch Token (custom domain) ```ts IdBoltSession.createFromLaunch(launch: IdBoltLaunch, options): IdBoltSession ``` Available since version `2.7`. Creates a session from a launch token that your server created. On a custom domain, ID Bolt 2.7 and higher requires this method. See [Custom Domain Launch Token](../launch-token). #### Starting a Session ```ts async session.start(): Promise ``` Launches the ID Bolt user interface and begins the scanning workflow. Returns a unique session ID for tracking. #### Resource Management ```ts IdBoltSession.terminate(): void ``` When the `keepAliveForNextSession` (default: false) option is selected, this method can be used to clean up resources after the last session ended. If this option is not selected, there is no need to call this method. ### Configuration Options The following options can be configured when creating an ID Bolt session: | Option | Type | Required | Description | Details | Since | | --------------------------- | ------------------- | -------- | --------------------------------------------------- | ------------------------------------------- | ----- | | `licenseKey` | `string` | Yes | Your Scandit license key | | 1.0 | | `documentSelection` | `DocumentSelection` | Yes | Defines acceptable documents | [Document Selection](../document-selection) | 1.0 | | `returnDataMode` | `ReturnDataMode` | Yes | Controls what data is returned | [Data Handling](../data-handling) | 1.0 | | `anonymizationMode` | `AnonymizationMode` | No | Controls data anonymization | [Data Handling](../data-handling) | 1.3 | | `anonymizedFields` | `AnonymizedFields` | No | Fine-grained control over which fields to anonymize | [Data Handling](../data-handling) | 2.2 | | `scanner` | `Scanner` | No | Customizes scanner behavior | [Workflow Options](../workflow) | 1.2 | | `validation` | `Validators[]` | No | Validators to verify ID | [Validators](../validators) | 1.0 | | `locale` | `string` | No | Interface language | [Supported Locales](#supported-locales) | 1.1 | | `workflow` | `WorkflowOptions` | No | Customizes workflow UI | [Workflow Options](../workflow) | 1.1 | | `theme` | `Theme` | No | Customizes visual appearance | [Theming](../theming) | 1.1 | | `textOverrides` | `TextOverrides` | No | Customizes displayed text | [Text Overrides](../text-overrides) | 1.2 | | `keepAliveForNextSession` | `boolean` | No | Keeps resources for multiple sessions | [Advanced Options](../advanced) | 1.6 | | `disableCloseOnBrowserBack` | `boolean` | No | Prevents closing on browser back | [Advanced Options](../advanced) | 1.14 | | `externalTransactionId` | `string` | No | Your tracking ID for analytics | [Advanced Options](../advanced) | 1.17 | | `learnMore` | `LearnMore` | No | Customize the "learn more" section | | 2.0 | | `onCompletion` | `Function` | Yes | Completion callback | [Callbacks](../callbacks) | 1.0 | | `onCancellation` | `Function` | No | Cancellation callback | [Callbacks](../callbacks) | 1.0 | ### Supported Locales The following languages are supported: - `en-US` (English, United States - default) - `de-DE` (German, Germany) - `de-CH` (German, Switzerland) - `es-ES` (Spanish, Spain) - `fr-FR` (French, France) - `it-IT` (Italian, Italy) - `nl-NL` (Dutch, Netherlands) - `pl-PL` (Polish, Poland) - `pt-PT` (Portuguese, Portugal) - `da-DK` (Danish, Denmark) --- ## 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. ```ts 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: | Property | Type | Description | Since | | ------------ | ------------ | ------------------------------------------------------------------------------------------------ | ----- | | `capturedId` | `CapturedId` | The 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. ```ts 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: | Value | Description | Since | | ---------------------------------------- | ------------------------------------------------------------------------- | ----- | | `CancellationReason.UserClosed` | The user closed the ID Bolt pop-up before completing the scanning process | 1.1 | | `CancellationReason.ServiceStartFailure` | The ID Bolt service failed to start | 1.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 | Property | Type | Description | Since | | -------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | | `firstName` | `string` | First name of the document holder | 1.0 | | `lastName` | `string` | Last name of the document holder | 1.0 | | `fullName` | `string` | Full name of the document holder | 1.0 | | `sex` | `string` | Sex/gender of the document holder | 1.0 | | `nationality` | `string` | Nationality of the document holder | 1.0 | | `address` | `string` | Address of the document holder | 1.0 | | `issuingCountry` | `Region` | The ISO (Alpha-3 code) abbreviation of the issuing country | 1.0 | | `documentNumber` | `string` | Unique identifier assigned to the document | 1.0 | | `documentAdditionalNumber` | `string` | Secondary identification number if present | 1.0 | | `personalIdNumber` | `string` | Personal identification number of the document holder | 1.3 | | `dateOfBirth` | `DateResult` | Date of birth of the document holder | 1.0 | | `age` | `number` | Calculated age based on date of birth | 1.0 | | `dateOfExpiry` | `DateResult` | Expiration date of the document | 1.0 | | `isExpired` | `boolean` | Whether the document is expired | 1.0 | | `dateOfIssue` | `DateResult` | Date when the document was issued | 1.0 | | `documentType` | `DocumentType` | Type of document (for example, `"Passport"`, `"IdCard"`, `"DriverLicense"`, `"VisaIcao"`, `"ResidencePermit"`, `"HealthInsuranceCard"`, `"RegionSpecific"`) | 1.0 | | `documentSubtype` | `string \| null` | Subtype of the document, if applicable | 2.1 | | `capturedResultTypes` | `string[]` | Types of data that were captured | 1.0 | | `nationalityISO` | `string \| null` | ISO code of the nationality | 2.1 | | `isCitizenPassport` | `boolean` | Whether the document is a citizen passport | 2.1 | | `images` | `object \| null` | Object containing base64 encoded images (if requested) | 1.0 | | `mrzResult` | `MrzResult \| null` | Raw extracted data from Machine Readable Zone (MRZ) | 1.6 | | `vizResult` | `VizResult \| null` | Raw extracted data from Visual Inspection Zone (VIZ) | 1.11 | | `barcodeResult` | `BarcodeResult \| null` | Raw extracted data from barcode | 2.1 | | `anonymizedFields` | `IdFieldType[]` | List of fields that were anonymized for this document | 2.2 | #### DateResult Object Date values are represented as `DateResult` objects: | Property | Type | Description | Since | | -------- | -------- | ----------------------- | ----- | | `day` | `number` | Day of the month (1-31) | 1.0 | | `month` | `number` | Month (1-12) | 1.0 | | `year` | `number` | Four-digit year | 1.0 | #### Images Object If you've used `ReturnDataMode.FullWithImages`, the `images` property will contain front and back image sets: ```ts images: { front: ImageSet; back: ImageSet; } | null ``` Each `ImageSet` contains: | Property | Type | Description | Since | | ----------------- | ---------------- | --------------------------------------------------------------------------------------------------------- | ----- | | `face` | `string \| null` | Cropped face image extracted from the document (base64 encoded) | 2.0 | | `croppedDocument` | `string \| null` | Cropped image of the document, only available when the visual inspection zone is scanned (base64 encoded) | 2.0 | | `frame` | `string \| null` | Full frame image of the captured document (base64 encoded) | 2.0 | In version 1.x, `images` has a different structure: | Property | Type | Description | Since | | ----------- | ---------- | --------------------------------------------------------------------------------------------- | ----- | | `cropped` | `string[]` | Cropped images of the ID in the order they were captured (only available when VIZ is scanned) | 1.0 | | `fullFrame` | `string[]` | Full frame images in the order they were captured | 1.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`: | Property | Type | Description | Since | | ---------------- | ------------------- | ------------------------------------------------- | ----- | | `firstName` | `string \| null` | First name of the document holder | 1.6 | | `lastName` | `string \| null` | Last name of the document holder | 1.6 | | `fullName` | `string \| null` | Full name of the document holder | 1.6 | | `sex` | `string \| null` | Sex/gender of the document holder | 1.6 | | `nationality` | `string \| null` | Nationality of the document holder | 1.6 | | `address` | `string \| null` | Address of the document holder | 1.6 | | `documentNumber` | `string \| null` | Unique identifier assigned to the document | 1.6 | | `dateOfBirth` | `DateResult \| null`| Date of birth of the document holder | 1.6 | | `dateOfExpiry` | `DateResult \| null`| Expiration date of the document | 1.6 | | `dateOfIssue` | `DateResult \| null`| Date when the document was issued | 1.6 | #### MrzResult Object Raw data extracted from the Machine Readable Zone (MRZ). In addition to the [common fields](#common-result-fields), it contains: | Property | Type | Description | Since | | -------------------------------- | -------------------- | ------------------------------------------------------------------- | ----- | | `capturedMrz` | `string \| null` | The raw MRZ text as read from the document | 1.6 | | `documentCode` | `string \| null` | Document code from the MRZ | 1.6 | | `fullNameSimplifiedChinese` | `string \| null` | Full name in simplified Chinese, when present | 1.6 | | `issuingAuthorityCode` | `string \| null` | Code of the authority that issued the document | 1.6 | | `namesAreTruncated` | `boolean \| null` | Whether the names in the MRZ were truncated | 1.6 | | `omittedCharacterCountInGbkName` | `number \| null` | Number of characters omitted from the GBK-encoded name | 1.6 | | `omittedNameCount` | `number \| null` | Number of names omitted | 1.6 | | `optionalDataInLine1` | `string \| null` | Optional data contained in the first MRZ line | 1.6 | | `optionalDataInLine2` | `string \| null` | Optional data contained in the second MRZ line | 1.6 | | `passportDateOfExpiry` | `DateResult \| null` | Expiration date of the passport (for documents attached to one) | 1.6 | | `passportIssuerIso` | `string \| null` | ISO code of the passport issuer | 1.6 | | `passportNumber` | `string \| null` | Passport number | 1.6 | | `passportType` | `string \| null` | Passport type, derived from the MRZ document code | 2.7 | | `personalIdNumber` | `string \| null` | Personal identification number of the document holder | 1.6 | | `renewalTimes` | `number \| null` | Number of times the document has been renewed | 1.6 | #### VizResult Object Raw data extracted from the Visual Inspection Zone (VIZ). In addition to the [common fields](#common-result-fields), it contains: | Property | Type | Description | Since | | ------------------------------ | ------------------------------- | -------------------------------------------------------------- | ----- | | `additionalAddressInformation` | `string \| null` | Additional address information | 1.11 | | `additionalNameInformation` | `string \| null` | Additional name information | 1.11 | | `bloodType` | `string \| null` | Blood type of the document holder | 1.11 | | `capturedSides` | `string \| null` | Which sides of the document were captured | 1.11 | | `documentAdditionalNumber` | `string \| null` | Secondary identification number if present | 1.11 | | `drivingLicenseDetails` | `DrivingLicenseDetails \| null` | Driving license details, when applicable | 1.11 | | `employer` | `string \| null` | Employer of the document holder | 1.11 | | `fathersName` | `string \| null` | Father's name of the document holder | 1.11 | | `isBackSideCaptureSupported` | `boolean \| null` | Whether the back side of the document supports capture | 1.11 | | `issuingAuthority` | `string \| null` | Authority that issued the document | 1.11 | | `issuingJurisdiction` | `string \| null` | Jurisdiction that issued the document | 1.11 | | `issuingJurisdictionIso` | `string \| null` | ISO code of the issuing jurisdiction | 1.11 | | `maritalStatus` | `string \| null` | Marital status of the document holder | 1.11 | | `mothersName` | `string \| null` | Mother's name of the document holder | 1.11 | | `passportNumber` | `string \| null` | Passport number | 1.11 | | `personalIdNumber` | `string \| null` | Personal identification number of the document holder | 1.11 | | `placeOfBirth` | `string \| null` | Place of birth of the document holder | 1.11 | | `profession` | `string \| null` | Profession of the document holder | 1.11 | | `race` | `string \| null` | Race of the document holder | 1.11 | | `religion` | `string \| null` | Religion of the document holder | 1.11 | | `residentialStatus` | `string \| null` | Residential status of the document holder | 1.11 | | `sponsor` | `string \| null` | Sponsor of the document holder | 1.11 | | `usRealIdStatus` | `string \| null` | US Real ID compliance status | 1.11 | | `vehicleOwner` | `string \| null` | Vehicle owner information | 1.11 | | `visaNumber` | `string \| null` | Visa number | 1.11 | | `visaDetails` | `VisaDetails \| null` | Visa details, when applicable | 1.11 | ##### DrivingLicenseDetails Object | Property | Type | Description | Since | | -------------------------- | --------------------------- | ----------------------------------------------- | ----- | | `drivingLicenseCategories` | `DrivingLicenseCategory[]` | List of driving license categories | 1.11 | | `restrictions` | `string \| null` | Driving restrictions | 1.11 | | `endorsements` | `string \| null` | Driving endorsements | 1.11 | ##### DrivingLicenseCategory Object | Property | Type | Description | Since | | -------------- | -------------------- | ---------------------------------------- | ----- | | `code` | `string` | Category code | 1.11 | | `dateOfIssue` | `DateResult \| null` | Date the category was issued | 1.11 | | `dateOfExpiry` | `DateResult \| null` | Date the category expires | 1.11 | ##### VisaDetails Object | Property | Type | Description | Since | | -------------------- | -------------------- | -------------------------------------------- | ----- | | `fullName` | `string \| null` | Full name on the visa | 1.11 | | `applicationStatus` | `string \| null` | Application status of the visa | 1.11 | | `dateOfIssue` | `DateResult \| null` | Date the visa was issued | 1.11 | | `durationInDays` | `number \| null` | Validity duration in days | 1.11 | | `geographicValidity` | `string \| null` | Geographic validity of the visa | 1.11 | | `issuingCountryIso` | `string \| null` | ISO code of the issuing country | 1.11 | | `issuingAuthority` | `string \| null` | Authority that issued the visa | 1.11 | | `multipleEntries` | `boolean` | Whether the visa allows multiple entries | 1.11 | | `numberOfEntries` | `number \| null` | Number of allowed entries | 1.11 | | `passportNumber` | `string \| null` | Passport number associated with the visa | 1.11 | | `visaNumber` | `string \| null` | Visa number | 1.11 | | `validFrom` | `DateResult \| null` | Date from which the visa is valid | 1.11 | | `validUntil` | `DateResult \| null` | Date until which the visa is valid | 1.11 | | `visaType` | `string \| null` | Type of visa | 1.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](#common-result-fields), it contains: | Property | Type | Description | Since | | ----------------------------------- | -------------------------------- | -------------------------------------------------------------- | ----- | | `aamvaVersion` | `number \| null` | AAMVA specification version of the barcode | 2.1 | | `aliasFamilyName` | `string \| null` | Alias family name | 2.1 | | `aliasGivenName` | `string \| null` | Alias given name | 2.1 | | `aliasSuffixName` | `string \| null` | Alias suffix name | 2.1 | | `barcodeDataElements` | `Record` | Raw barcode data elements keyed by element identifier | 2.1 | | `barcodeMetadata` | `BarcodeMetadata \| null` | Metadata about the barcode itself | 2.1 | | `bloodType` | `string \| null` | Blood type of the document holder | 2.1 | | `branchOfService` | `string \| null` | Branch of service (military documents) | 2.1 | | `cardInstanceIdentifier` | `string \| null` | Card instance identifier | 2.1 | | `cardRevisionDate` | `DateResult \| null` | Card revision date | 2.1 | | `categories` | `string[]` | Document categories | 2.1 | | `champusEffectiveDate` | `DateResult \| null` | CHAMPUS effective date | 2.1 | | `champusExpiryDate` | `DateResult \| null` | CHAMPUS expiry date | 2.1 | | `citizenshipStatus` | `string \| null` | Citizenship status | 2.1 | | `civilianHealthCareFlagCode` | `string \| null` | Civilian health care flag code | 2.1 | | `civilianHealthCareFlagDescription` | `string \| null` | Civilian health care flag description | 2.1 | | `commissaryFlagCode` | `string \| null` | Commissary flag code | 2.1 | | `commissaryFlagDescription` | `string \| null` | Commissary flag description | 2.1 | | `countryOfBirth` | `string \| null` | Country of birth | 2.1 | | `countryOfBirthIso` | `string \| null` | ISO code of the country of birth | 2.1 | | `deersDependentSuffixCode` | `number \| null` | DEERS dependent suffix code | 2.1 | | `deersDependentSuffixDescription` | `string \| null` | DEERS dependent suffix description | 2.1 | | `directCareFlagCode` | `string \| null` | Direct care flag code | 2.1 | | `directCareFlagDescription` | `string \| null` | Direct care flag description | 2.1 | | `documentCopy` | `string \| null` | Document copy indicator | 2.1 | | `documentDiscriminatorNumber` | `string \| null` | Document discriminator number | 2.1 | | `driverNamePrefix` | `string \| null` | Driver name prefix | 2.1 | | `driverNameSuffix` | `string \| null` | Driver name suffix | 2.1 | | `driverRestrictionCodes` | `number[]` | Driver restriction codes | 2.1 | | `ediPersonIdentifier` | `string \| null` | EDI person identifier | 2.1 | | `endorsementsCode` | `string \| null` | Endorsements code | 2.1 | | `exchangeFlagCode` | `string \| null` | Exchange flag code | 2.1 | | `exchangeFlagDescription` | `string \| null` | Exchange flag description | 2.1 | | `eyeColor` | `string \| null` | Eye color of the document holder | 2.1 | | `familySequenceNumber` | `number \| null` | Family sequence number | 2.1 | | `firstNameTruncation` | `string \| null` | First name truncation indicator | 2.1 | | `firstNameWithoutMiddleName` | `string \| null` | First name without the middle name | 2.1 | | `formNumber` | `string \| null` | Form number | 2.1 | | `genevaConventionCategory` | `string \| null` | Geneva Convention category | 2.1 | | `hairColor` | `string \| null` | Hair color of the document holder | 2.1 | | `heightCm` | `number \| null` | Height in centimeters | 2.1 | | `heightInch` | `number \| null` | Height in inches | 2.1 | | `iin` | `string \| null` | Issuer identification number | 2.1 | | `identificationType` | `string \| null` | Identification type | 2.1 | | `isRealId` | `boolean \| null` | Whether the document is a US Real ID | 2.1 | | `issuingJurisdiction` | `string \| null` | Jurisdiction that issued the document | 2.1 | | `issuingJurisdictionIso` | `string \| null` | ISO code of the issuing jurisdiction | 2.1 | | `jpegData` | `string \| null` | JPEG image data embedded in the barcode | 2.1 | | `jurisdictionVersion` | `number \| null` | Jurisdiction version | 2.1 | | `lastNameTruncation` | `string \| null` | Last name truncation indicator | 2.1 | | `licenseCountryOfIssue` | `string \| null` | Country of issue of the license | 2.1 | | `middleName` | `string \| null` | Middle name of the document holder | 2.1 | | `middleNameTruncation` | `string \| null` | Middle name truncation indicator | 2.1 | | `mwrFlagCode` | `string \| null` | MWR flag code | 2.1 | | `mwrFlagDescription` | `string \| null` | MWR flag description | 2.1 | | `payGrade` | `string \| null` | Pay grade | 2.1 | | `payPlanCode` | `string \| null` | Pay plan code | 2.1 | | `payPlanGradeCode` | `string \| null` | Pay plan grade code | 2.1 | | `personDesignatorDocument` | `number \| null` | Person designator document | 2.1 | | `personDesignatorTypeCode` | `string \| null` | Person designator type code | 2.1 | | `personMiddleInitial` | `string \| null` | Person middle initial | 2.1 | | `personalIdNumber` | `string \| null` | Personal identification number of the document holder | 2.1 | | `personalIdNumberType` | `string \| null` | Type of personal identification number | 2.1 | | `personnelCategoryCode` | `string \| null` | Personnel category code | 2.1 | | `personnelEntitlementConditionType` | `string \| null` | Personnel entitlement condition type | 2.1 | | `placeOfBirth` | `string \| null` | Place of birth of the document holder | 2.1 | | `professionalDrivingPermit` | `ProfessionalDrivingPermit \| null` | Professional driving permit details | 2.1 | | `race` | `string \| null` | Race of the document holder | 2.1 | | `rank` | `string \| null` | Rank (military documents) | 2.1 | | `relationshipCode` | `string \| null` | Relationship code | 2.1 | | `relationshipDescription` | `string \| null` | Relationship description | 2.1 | | `restrictionsCode` | `string \| null` | Restrictions code | 2.1 | | `securityCode` | `string \| null` | Security code | 2.1 | | `serviceCode` | `string \| null` | Service code | 2.1 | | `sponsorFlag` | `string \| null` | Sponsor flag | 2.1 | | `sponsorName` | `string \| null` | Sponsor name | 2.1 | | `sponsorPersonDesignatorIdentifier` | `number \| null` | Sponsor person designator identifier | 2.1 | | `statusCode` | `string \| null` | Status code | 2.1 | | `statusCodeDescription` | `string \| null` | Status code description | 2.1 | | `vehicleClass` | `string \| null` | Vehicle class | 2.1 | | `vehicleRestrictions` | `VehicleRestriction[]` | Vehicle restrictions | 2.1 | | `version` | `string \| null` | Barcode version | 2.1 | | `weightKg` | `number \| null` | Weight in kilograms | 2.1 | | `weightLbs` | `number \| null` | Weight in pounds | 2.1 | ##### BarcodeMetadata Object | Property | Type | Description | Since | | ----------------- | ---------------- | ------------------------------------ | ----- | | `errorCorrection` | `number \| null` | Barcode error correction level | 2.1 | | `moduleCountX` | `number \| null` | Number of barcode modules on the X axis | 2.1 | | `moduleCountY` | `number \| null` | Number of barcode modules on the Y axis | 2.1 | ##### ProfessionalDrivingPermit Object | Property | Type | Description | Since | | -------------- | -------------------- | ------------------------------------ | ----- | | `codes` | `string[]` | Professional driving permit codes | 2.1 | | `dateOfExpiry` | `DateResult \| null` | Expiry date of the permit | 2.1 | ##### VehicleRestriction Object | Property | Type | Description | Since | | -------------------- | -------------------- | ------------------------------------ | ----- | | `vehicleCode` | `string` | Vehicle code | 2.1 | | `vehicleRestriction` | `string` | Vehicle restriction | 2.1 | | `dateOfIssue` | `DateResult \| null` | Date the restriction was issued | 2.1 | ### Example: Complete Callback Usage ```ts 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 } } }, }); ``` --- ## 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: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... returnDataMode: ReturnDataMode.Full, }); ``` #### Available Modes | Value | Description | Since | | ------------------------------- | ------------------------------------------------------------------ | ----- | | `ReturnDataMode.Full` | All extracted data is returned, but images are excluded | 1.0 | | `ReturnDataMode.FullWithImages` | All extracted data is returned, including images of the scanned ID | 1.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: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... anonymizationMode: AnonymizationMode.FieldsOnly, }); ``` #### Available Modes | Value | Description | Since | | ----------------------------------- | ------------------------------------- | ----- | | `AnonymizationMode.None` | No anonymization is applied (default) | 1.3 | | `AnonymizationMode.FieldsOnly` | Only fields (data) are anonymized | 1.3 | | `AnonymizationMode.ImagesOnly` | Only images are anonymized | 1.3 | | `AnonymizationMode.FieldsAndImages` | Both fields and images are anonymized | 1.3 | :::note ID Bolt's default differs from the ID Capture SDK's. ID Bolt applies `AnonymizationMode.None` unless you set another mode, while the ID Capture SDK defaults to `FieldsOnly`. To get the SDK's behavior, set `anonymizationMode: AnonymizationMode.FieldsOnly`. ::: #### 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. ```ts 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: | Property | Type | Description | Since | | --------------- | ------------------------ | ----------------------------------------------------------------------------------- | ----- | | `defaultFields` | `boolean` | When `true`, the default set of sensitive fields is anonymized. | 2.2 | | `extraFields` | `AnonymizedFieldEntry[]` | 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: | Property | Type | Description | Since | | ---------- | ------------------- | ----------------------------------------------------------------------------------------------- | ----- | | `document` | `IdCaptureDocument` | The document type this entry applies to (for example, `new Passport(Region.Any)`, `new IdCard("USA")`). | 2.2 | | `fields` | `IdFieldType[]` | The fields to anonymize for this document type. | 2.2 | #### Available Field Types The `IdFieldType` enum defines the fields that can be anonymized: | Value | Description | Since | | ------------------------------------------ | ------------------------------ | ----- | | `IdFieldType.FirstName` | First name | 2.2 | | `IdFieldType.LastName` | Last name | 2.2 | | `IdFieldType.FullName` | Full name | 2.2 | | `IdFieldType.Sex` | Sex/gender | 2.2 | | `IdFieldType.Nationality` | Nationality | 2.2 | | `IdFieldType.Address` | Address | 2.2 | | `IdFieldType.AdditionalAddressInformation` | Additional address information | 2.2 | | `IdFieldType.AdditionalNameInformation` | Additional name information | 2.2 | | `IdFieldType.Age` | Age | 2.2 | | `IdFieldType.DateOfBirth` | Date of birth | 2.2 | | `IdFieldType.DateOfExpiry` | Date of expiry | 2.2 | | `IdFieldType.DateOfIssue` | Date of issue | 2.2 | | `IdFieldType.DocumentNumber` | Document number | 2.2 | | `IdFieldType.DocumentAdditionalNumber` | Document additional number | 2.2 | | `IdFieldType.PersonalIdNumber` | Personal ID number | 2.2 | | `IdFieldType.IssuingAuthority` | Issuing authority | 2.2 | | `IdFieldType.PlaceOfBirth` | Place of birth | 2.2 | | `IdFieldType.Profession` | Profession | 2.2 | | `IdFieldType.Employer` | Employer | 2.2 | | `IdFieldType.MaritalStatus` | Marital status | 2.2 | | `IdFieldType.FathersName` | Father's name | 2.2 | | `IdFieldType.MothersName` | Mother's name | 2.2 | | `IdFieldType.Race` | Race | 2.2 | | `IdFieldType.Religion` | Religion | 2.2 | | `IdFieldType.BloodType` | Blood type | 2.2 | | `IdFieldType.ResidentialStatus` | Residential status | 2.2 | | `IdFieldType.MrzOptionalDataInLine1` | MRZ optional data in line 1 | 2.2 | | `IdFieldType.MrzOptionalDataInLine2` | MRZ optional data in line 2 | 2.2 | | `IdFieldType.BarcodeDictionary` | Barcode dictionary | 2.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. --- ## Document Selection ID Bolt allows you to specify which types of documents are acceptable for scanning. Documents are selected using the `DocumentSelection` class. ### Creating a Document Selection Use `DocumentSelection.create()` to define which types of documents the ID Bolt will accept: ```ts const documentSelection = DocumentSelection.create({ accepted: [ new Passport(Region.Any), new IdCard(Region.FRA), new DriverLicense(Region.France), ], rejected: [ // You can explicitly reject certain documents that would otherwise be included new Passport(Region.Switzerland), ], }); ``` Documents not on the list may trigger the scanner, but will not be accepted. ### Standard Document Types #### Passport Includes all passports. ```ts new Passport(Region.USA); // US passports only new Passport(Region.Any); // Any passport ``` #### ID Card Includes national identity cards. ```ts new IdCard(Region.Germany); // German identity cards only new IdCard(Region.Any); // Identity cards from any country ``` #### Driver License Includes driver licenses. ```ts new DriverLicense(Region.France); // French driver licenses only new DriverLicense(Region.Any); // Driver licenses from any country ``` #### Visa (ICAO) Includes visas that comply with International Civil Aviation Organization (ICAO) standards. ```ts new VisaIcao(Region.USA); // US ICAO-compliant visas new VisaIcao(Region.Any); // Any ICAO-compliant visa ``` #### Residence Permit Includes residence permits. ```ts new ResidencePermit(Region.USA); // US residence permits new ResidencePermit(Region.Any); // Residence permits from any country ``` #### Health Insurance Card Includes health insurance cards. ```ts new HealthInsuranceCard(Region.Germany); // German health insurance cards new HealthInsuranceCard(Region.Any); // Health insurance cards from any country ``` ### Region Specific Documents For specialized document types that are specific to certain regions, use the `RegionSpecific` class with a `RegionSpecificSubtype` argument: ```ts new RegionSpecific(RegionSpecificSubtype.BelgiumMinorsId); // Belgian minors ID new RegionSpecific(RegionSpecificSubtype.MexicoTaxId); // Mexican tax ID ``` #### Supported Region Specific Documents The following region-specific document types are supported: ##### United States - `UsBorderCrossingCard` - `UsGlobalEntryCard` - `UsNexusCard` - `UsCommonAccessCard` - `UsUniformedServicesId` - `UsVeteranId` - `UsWorkPermit` - `UsSocialSecurityCard` - `UsTwicCard` - `UsWeaponPermit` - `UsMedicalMarijuanaCard` - `UsMunicipalId` ##### Asia - `ChinaExitEntryPermit` - `ChinaMainlandTravelPermitTaiwan` - `ChinaMainlandTravelPermitHongKongMacau` - `ChinaOneWayPermit` - `PakistanAfghanCitizenCard` - `PakistanProofOfRegistration` - `PakistanConsularId` - `SingaporeFinCard` - `SingaporeWorkPermit` - `SingaporeEmploymentPass` - `SingaporeSPass` - `IndiaPanCard` - `MalaysiaIkad` - `MalaysiaMykad` - `MalaysiaMypr` - `MalaysiaMykas` - `MalaysiaMykid` - `MalaysiaMytentera` - `MalaysiaRefugeeId` - `MalaysiaMypolis` - `PhilippinesMultipurposeId` - `PhilippinesWorkPermit` - `PhilippinesSocialSecurityCard` - `PhilippinesNbiClearance` - `PhilippinesPostalId` - `PhilippinesTaxId` ##### Europe - `GermanyEid` - `BelgiumMinorsId` - `HungaryAddressCard` - `UkAsylumRequest` - `UkMilitaryId` - `SwedenSocialSecurityCard` - `SwedenSisId` - `IrelandPublicServicesCard` ##### Americas - `MexicoConsularVoterId` - `MexicoProfessionalId` - `MexicoConsularId` - `MexicoTaxId` - `CanadaTribalId` - `CanadaSocialSecurityCard` - `CanadaCitizenshipCertificate` - `CanadaMinorsPublicServicesCard` - `CanadaWeaponPermit` - `CanadaPublicServicesCard` - `ColombiaMinorsId` - `ColombiaTemporaryProtectionPermit` - `PeruMinorsId` - `BoliviaMinorsId` - `GuatemalaConsularId` ##### Other - `ApecBusinessTravelCard` - `AustraliaAsicCard` - `UaeVehicleRegistrationCard` - `UaeEsaadCard` ### Working with Regions Regions are used to define the geographic scope of a document. They can be specified using the `Region` enum, which contains both ISO codes and region names. ```ts // These are equivalent Region.FRA; Region.France; ("FRA"); // For any region Region.Any; ``` #### Two-letter ISO Codes If you have a two-letter ISO code, you can convert it to a region: ```ts const region = Region.fromShortCode("FR"); // == Region.France == "FRA" const shortCode = Region.toShortCode(Region.FRA); // == "FR" ``` If the provided short code is invalid, the methods will throw an exception. --- ## Getting Started 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](https://www.npmjs.com/package/@scandit/web-id-bolt) and can be installed using `npm` or `yarn`. **npm** ```bash npm install @scandit/web-id-bolt ``` **yarn** ```bash yarn add @scandit/web-id-bolt ``` ### Content Security Policy (CSP) If you have `Content-Security-Policy` headers (CSP) which prevent loading iframes on your page, you need to adapt the value like so: ``` frame-src 'self' https://app.id-scanning.com https://id-service.scandit.com ``` This allows ID Bolt to load the necessary iframe components for the scanning interface. :::note If you use a custom domain, use your domain in place of `https://app.id-scanning.com`. For example: ``` frame-src 'self' https://scan.example.com ``` ::: ### Basic Integration 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](https://ssl.scandit.com/dashboard/sign-up?p=id-bolt). ::: 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: ```ts import { DocumentSelection, IdBoltSession, Region, Passport, ReturnDataMode, 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({ accepted: [new Passport(Region.Any)], }); // 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 callback returnDataMode: ReturnDataMode.Full, // add validation rules on the scanned document validation: [Validators.notExpired()], locale: "en-US", onCompletion: (result) => { // the ID has been captured and validation was successful. }, onCancellation: (reason) => { // the ID Bolt pop-up has been closed by the user without finishing the scan process. }, }); // open the pop-up await idBoltSession.start(); } // open ID Bolt when some button is clicked const someButton = document.getElementById("someButton") as HTMLButtonElement; someButton.addEventListener("click", startIdBolt); ``` For completeness this is the HTML you will need for the example: ```html ``` 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. ### Custom Domain If you use a custom domain, a secure and complete setup requires a launch token. Your server creates a launch token for each session, and the page starts ID Bolt with `IdBoltSession.createFromLaunch` in place of `IdBoltSession.create`. On a custom domain, ID Bolt 2.7 and higher does not start a session without a valid launch token. See [Custom Domain Launch Token](../launch-token) for details. --- ## Custom Domain Launch Token Available since version `2.7`. When ID Bolt runs on your own custom domain (for example, `scan.example.com`), use a **launch token** to make sure that only your website can start sessions on this domain. Without a launch token, a malicious actor could forge sessions on your domain and send users to them. With a launch token: 1. Your **server** creates a launch token with a secret API key. The server sends the launch token and the session configuration, as a JSON string, to the page in a `launch` object. Create the launch token immediately before you open ID Bolt and, if possible, only for an authenticated user. 2. Your **page** starts ID Bolt with this `launch` object. 3. ID Bolt verifies the token on the desktop and on the smartphone. If the token is not valid, not for your domain, or the configuration was changed, the session does not start and ID Bolt shows an error page. The configuration does not go to the Scandit servers. Your server sends only the SHA-256 digest of the configuration string, and ID Bolt compares it with the digest of the string that it receives in the browser. Thus the content of the configuration, for example text overrides that contain personal data, stays between your server, your page, and the devices of the user. :::warning On a custom domain, ID Bolt 2.7 and higher requires a launch token. Integrate launch tokens before you upgrade. Scandit can also make launch tokens necessary for older ID Bolt versions on your custom domain. Shared Scandit domains (for example, `app.id-scanning.com`) do not require a launch token. ::: ### Get an API Key Contact Scandit support to get a secret API key for your custom domain. Each API key is bound to one custom domain. You can have more than one key for the same domain, and one key for each additional domain. :::caution The API key is a secret. Use it only on your server. Do not send it to the browser. ::: ### Create a Launch Token on Your Server Create the launch token on your server with a REST call to your custom domain. If your backend uses Node.js, you can also use the [Node.js server SDK](#nodejs-server-sdk). #### REST API To create a launch token: 1. Write the configuration as a JSON string, with any JSON library. See [Launch Configuration](#launch-configuration). 2. Calculate the SHA-256 digest of the UTF-8 bytes of this string, as lowercase hexadecimal. 3. Send only the digest to `POST https:///api/v1/launch-tokens`. 4. Add the configuration string, unchanged, to the response as `configuration`. The result is the `launch` object. Send it to the page. Example in Python: ```python import hashlib, json, secrets, requests configuration = json.dumps({ "licenseKey": "<>", "documentSelection": {"acceptedDocuments": [{"type": "Passport", "region": "Any"}]}, "returnDataMode": "Full", "textOverrides": {"titles.SCANNER_HEADER": "Scan the passport of Jane Doe"}, "nonce": secrets.token_hex(16), }) response = requests.post( "https://scan.example.com/api/v1/launch-tokens", headers={"Authorization": f"Bearer {ID_BOLT_API_KEY}"}, json={"configurationDigest": hashlib.sha256(configuration.encode("utf-8")).hexdigest()}, ) launch = response.json() launch["configuration"] = configuration # the string itself: do not parse and serialize it again! ``` The request has these headers: - `Authorization: Bearer ` - `Content-Type: application/json` The request body has one field: - `configurationDigest` (string, required): the SHA-256 digest of the configuration string, as 64 lowercase hexadecimal characters. :::note The validation is strict. An unknown field in the body gives a `400` response. ::: The response is: ```json { "success": true, "serviceUrl": "https://scan.example.com", "launchToken": "...", "sessionId": "t-...", "expiresAt": "2026-10-22T10:30:00.000Z" } ``` `expiresAt` is an ISO 8601 date. Keep the `sessionId` to match the scan result with your records. The response does not contain the configuration. Before you send the `launch` object to the page, add your configuration string to it as `configuration`. **This value is the string itself, not a JSON object**. If the request fails, the response is `{ "success": false, "error": "..." }` with one of these status codes: - `400`: The body is not valid JSON (`"Invalid JSON body"`), or the digest is not valid (`configurationDigest: Invalid digest: expected the lowercase hex SHA-256 of the configuration string`). - `401`: The API key is missing or not valid (`"Unauthorized"`). #### Node.js Server SDK The `@scandit/web-id-bolt` package contains a server entry point, `@scandit/web-id-bolt/server`. Use the same package version as in the browser. Import it only in your backend (Node.js 20 or higher). The SDK makes the nonce, writes the configuration string, calculates the digest, and sends it. It returns the `launch` object, with the launch token and the configuration string. ```ts import { IdBoltServer } from "@scandit/web-id-bolt/server"; import { DocumentSelection, Passport, Region, ReturnDataMode } from "@scandit/web-id-bolt"; const idBoltServer = new IdBoltServer({ apiKey: ID_BOLT_API_KEY, serviceUrl: "https://scan.example.com", }); // Create one launch token for each page view that shows ID Bolt. const launch = await idBoltServer.createLaunch({ configuration: { licenseKey: LICENSE_KEY, documentSelection: DocumentSelection.create({ accepted: [new Passport(Region.Any)], }), returnDataMode: ReturnDataMode.Full, }, }); // Send `launch` to the page as it is. It is plain JSON: // { serviceUrl, launchToken, sessionId, expiresAt, configuration } ``` #### Launch Configuration The configuration contains the same options as `IdBoltSession.create`, except: - The functions: `validation`, `onCompletion`, `onCancellation`. - The browser-only options: `locale`, `keepAliveForNextSession`, `disableCloseOnBrowserBack`. You set these options on the page, in `createFromLaunch`. If you use the REST API, write the configuration as JSON. It accepts these fields. Except for `nonce`, they have the same names and values as the options of [`IdBoltSession.create`](../api-overview#configuration-options). ID Bolt fills in the default values of the fields that you do not set. | Field | JSON type | Required | Details | | ----------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `licenseKey` | `string` | Yes | Your Scandit license key | | `documentSelection` | `object` | Yes | `acceptedDocuments` is required. See [Document](#document) below and [Document Selection](../document-selection) | | `nonce` | `string` | Yes | At least 16 random characters, new for each launch token. Without a nonce, a person who knows the other fields could find the text overrides from the digest | | `returnDataMode` | `string` | No | [Data Handling](../data-handling) | | `anonymizationMode` | `string` | No | [Data Handling](../data-handling) | | `anonymizedFields` | `object` | No | [Data Handling](../data-handling) | | `scanner` | `object` | No | See [Scanner](#scanner) below and [Workflow Options](../workflow) | | `workflow` | `object` | No | [Workflow Options](../workflow) | | `theme` | `object` | No | [Theming](../theming) | | `textOverrides` | `object` | No | [Text Overrides](../text-overrides) | | `externalTransactionId` | `string` | No | [Advanced Options](../advanced) | | `learnMore` | `object` | No | Customize the "learn more" section | The service does not receive the configuration, so it cannot validate it when you create the launch token. ID Bolt validates it when the session starts. The validation is strict: an unknown field or a value that is not valid shows an error page that names the field. For example: `Invalid launch configuration: documentSelection.acceptedDocuments.0.region: Invalid region: expected an ISO 3166-1 alpha-3 code or "Any"`. :::tip To find these errors before the session starts, validate your configuration on your server with the JSON Schema of the launch configuration: [`https://app.id-scanning.com/schemas/launch-configuration.schema.json`](https://app.id-scanning.com/schemas/launch-configuration.schema.json). Use any JSON Schema validator, for example in your tests or before you calculate the digest. ::: Two shapes are different in JSON: [Document](#document) and [Scanner](#scanner). ##### Document `documentSelection` contains these fields: | Field | JSON type | Required | Details | | ------------------- | ------------ | -------- | ----------------------------- | | `acceptedDocuments` | `Document[]` | Yes | The documents that you accept | | `rejectedDocuments` | `Document[]` | No | The documents that you reject | A document contains these fields: | Field | JSON type | Required | Details | | --------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------ | | `type` | `string` | Yes | The document type, for example `"Passport"` or `"RegionSpecific"` | | `region` | `string` | Yes | An ISO 3166-1 alpha-3 code, for example `"DEU"`, or `"Any"` | | `subtype` | `string` | Only for `RegionSpecific` documents | The region-specific subtype, for example `"usNexusCard"`. Other document types cannot have a `subtype` | Examples: ```json { "type": "Passport", "region": "DEU" } { "type": "RegionSpecific", "region": "Any", "subtype": "usNexusCard" } ``` ##### Scanner `scanner` contains these fields: | Field | JSON type | Required | Details | | --------------------------- | --------- | ---------------------------- | ---------------------------------------------------------------------------------- | | `type` | `string` | Yes | `"full"` for the full document scanner, `"singleSide"` for the single side scanner | | `barcode` | `boolean` | Only for `"singleSide"` | Scan the barcode | | `machineReadableZone` | `boolean` | Only for `"singleSide"` | Scan the Machine Readable Zone (MRZ) | | `visualInspectionZone` | `boolean` | Only for `"singleSide"` | Scan the Visual Inspection Zone (VIZ) | | `enforceVizForPassportScan` | `boolean` | No (only for `"singleSide"`) | See [Passport VIZ Enforcement](../workflow#passport-viz-enforcement) | Examples: ```json { "type": "full" } { "type": "singleSide", "barcode": true, "machineReadableZone": true, "visualInspectionZone": true } ``` ##### Configuration String ID Bolt calculates the digest of the exact bytes of the configuration string. Any spacing and any valid JSON escape is correct. But do not parse and serialize the string again after you calculate the digest: if a byte changes, the digest does not match and the session does not start. To test your implementation, calculate the SHA-256 digest of this string: ``` {"licenseKey": "YOUR-LICENSE-KEY", "documentSelection": {"acceptedDocuments": [{"type": "Passport", "region": "Any"}]}, "textOverrides": {"titles.SCANNER_HEADER": "Scan the passport of Jos\u00e9"}, "nonce": "6f1c0e2a9b7d4c3e8a5f1b2d3c4e5f60"} ``` The result must be `24ba90f450f9b4f249104112514fbd0de76314ae6e2780e136573c1e619fac84`. The string contains `é` as a JSON escape of 6 characters, as Python's `json.dumps` writes it. If you use the character `é` in its place, the bytes are different and the digest is different. ### Start ID Bolt on the Page ```ts import { IdBoltSession } from "@scandit/web-id-bolt"; const idBoltSession = IdBoltSession.createFromLaunch(launch, { onCompletion: (result) => { // ... }, // Also available: onCancellation, validation, locale, // keepAliveForNextSession, disableCloseOnBrowserBack }); await idBoltSession.start(); ``` ID Bolt runs on `launch.serviceUrl` with `launch.configuration`. The page does not build the configuration again. `launch.configuration` must be a string: if it is not, `createFromLaunch` throws a `TypeError`. After the session starts, you cannot change the configuration. ### Token Lifetime and Usage - A launch token is valid for one session. It expires 30 minutes after you create it. The token must stay valid while the user is on the page and during the scan on the smartphone. - Create a new launch token for each session, immediately before you call `start()`. - Create launch tokens only for authenticated users. - Do not change the launch token or the configuration string. If the configuration string is different from the string that you used to create the launch token, the session does not start. On the page, you can still complete the configuration with the options that are not in the configuration string: `validation`, `onCompletion`, `onCancellation`, `locale`, `keepAliveForNextSession`, and `disableCloseOnBrowserBack`. Give only the options that you need to `IdBoltSession.createFromLaunch`. For example, on the page: ```ts import { IdBoltSession, Validators } from "@scandit/web-id-bolt"; // Correct: give the launch object as it is, and add only the options that you need. const idBoltSession = IdBoltSession.createFromLaunch(launch, { locale: "de-DE", validation: [Validators.notExpired()], onCompletion: (result) => { // ... }, }); await idBoltSession.start(); // Not correct: the configuration string changes, so the session does not start. const configuration = JSON.parse(launch.configuration); configuration.returnDataMode = "Full"; launch.configuration = JSON.stringify(configuration); ``` The second example fails even if you do not change a value: `JSON.stringify` can write the string with different spacing or escapes, and then the digest does not match. To change the configuration, create a new launch token on your server. --- ## ID Bolt ID Bolt is a hosted identity scanning solution that enables you to provide customers a fast, foolproof ID scanning in just 1 second, leading to an improved customer experience as well as compliance. Scandit hosts the scanning UI and keeps it up to date. The scanning itself runs on the user's device, in the browser, on desktop and mobile alike. Scandit's servers never see identity data in readable form, and on-device scanning reduces latency for quick scanning performance. :::tip In addition to ID Bolt, Scandit provides an [ID Capture SDK for the Web](/sdks/web/id-capture/intro.md) that allows full flexibility around the user interface and user flow. ::: ### Features ID Bolt offers the following features: - **Fast Scanning**: ID Bolt scans an ID in just 1 second. Scans are performed from video streams for the fastest possible scanning. - **On-Device Scanning/Processing**: ID Bolt scans IDs on the user's device, in the browser. Scandit's servers never see identity data in readable form, and processing on the device improves performance. - **Device Handover**: ID Bolt works on both desktop and mobile devices, providing a unified solution. Desktop/laptop users can scan IDs using their mobile device camera. The handover goes through Scandit's relay, end-to-end encrypted. - **Industry Leading UX**: ID Bolt presents a simple, intuitive interface, designed based on the millions of scans performed by Scandit customers each year. - **Compliance**: ID Bolt ensures compliance with data protection regulations, such as GDPR, by scanning on the device. Scandit's servers never see identity data in readable form, including during device handover. - **White-Label Solution**: ID Bolt can be placed behind your own domain, allowing you to maintain brand consistency and provide an integrated experience to your customers while leveraging Scandit's powerful ID scanning capabilities. --- ## Release Notes ### 2.7.0 **Released**: November 3, 2026 #### New Features - Added launch tokens for ID Bolt on a custom domain. Your server creates a signed launch token with a secret API key, and the page starts ID Bolt with this launch token. This prevents a malicious actor from forging sessions on your domain and sending users to them. See [Custom Domain Launch Token](../launch-token) for details. - Added the workflow option `allowHandover`. Set it to `false` to remove the step where desktop users scan a QR code to continue on their smartphone. See [workflow options](../workflow) for details. - Added the `passportType` field to `MrzResult`. See [Callbacks](../callbacks#mrzresult-object) for details. #### Improvements - Updated WebSDK to 8.6.2, which improves PDF417 barcode scanning (for example, on US driver's licenses). #### Breaking changes - On a custom domain, ID Bolt 2.7.0 and higher requires a launch token. Without a valid launch token, the session does not start and ID Bolt shows an error page. Before you upgrade, integrate launch tokens as described in [Custom Domain Launch Token](../launch-token). Shared Scandit domains (for example, `app.id-scanning.com`) do not require a launch token. - ID Bolt versions older than 1.11.0 are no longer supported. Upgrade to the latest version. ### 2.6.0 **Released**: August 3, 2026 #### New Features - Added a UMD (Universal Module Definition) bundle to the ID Bolt SDK (`index.umd.js`) for environments that do not support ES modules. #### Improvements - Added sound feedback when a document has been scanned. - Updated WebSDK to 8.5.1. #### Bug fixes - Fixed a camera error on Microsoft Surface devices that prevented end users from starting the camera stream. - Fixed detection of camera access being denied by the user. When this happens, a screen now explains how to unblock the camera. ##### ID Bolt configurator - Fixed the code snippet not updating when the `theme.banner` and `learnMore` options are changed through the UI. ### 2.5.0 **Released**: June 4, 2026 #### New Features - Added support for a configurable banner displayed at the top of ID Bolt on mobile devices. You can set the banner image, background color, horizontal alignment, and optional custom styling. #### Bug fixes - Fixed a license key domain validation issue in the ID Bolt configurator within the Scandit dashboard. ### 2.3.0 **Released**: April 14, 2026 #### Improvements - Workflow: Simplified the welcome screen flow for desktop users. A single button now guides the user to continue and scan their document via QR code. Additional scanning methods (webcam and image upload) remain available from a secondary page. #### New Features - Workflow options: `showWelcomeScreenDesktop` and `showWelcomeScreenMobile` allow you to control the welcome screen visibility independently on desktop and mobile. - image upload: give users an additional way to process their document by uploading an image or a pdf file. See [workflow options](../workflow) for details. #### Bug fixes - the scanner now resets correctly when a user scans the front of a document, navigates back, and returns to the scanner page. The user must then start over by scanning the front of their document. #### Deprecations - workflow option `showWelcomeScreen` is deprecated, use `showWelcomeScreenDesktop` and `showWelcomeScreenMobile` instead. ### 2.2.0 **Released**: February 24, 2026 #### New Features - Granular anonymization control: configure which specific fields to anonymize, either using a default set or by specifying extra fields per document type. See [Data Handling](../data-handling) for details. ### 2.1.0 **Released**: January 21, 2026 #### New Features - Allow scanning of the table on the back of EU driver licenses. - Include the full decoded barcode result when scanning barcode on the back of US driver licenses. ### 2.0.0 **Released**: January 12, 2026 #### New Features - Updated Scandit Data Capture SDK to 8.x. - ID-Bolt SDK changes to align with Scandit Data Capture SDK 8.x. - Learn-more feature: User customizable content and external link to provide more information about the scanning process. #### Bug Fixes - Improved translation strings with more concise error and success messaging. ### 1.19.0 **Released**: November 11, 2025 #### Bug Fixes - US RealID check now also checks RealID compliance for VIZ scan, before it would only check barcode. Requires update to ID-Bolt SDK 1.19.0. - Other minor bug fixes. ### 1.18.0 **Released**: October 21, 2025 #### New Features - New configurator to be included in the customer dashboard. ### 1.17.0 **Released**: October 6, 2025 #### New Features - Add option to enforce VIZ being scanned when scanning passports. - Support for UK Military ID and UAE ESAAD card. - Support for supplying an external transaction ID to ID-Bolt, for better analytics and tracking. #### Bug Fixes - Wrong help text being shown when scanning on mobile device with low resolution camera. - Show personal id number instead of document number in result screen, when document number is not available. - Fix incorrect caching issue during new version deployments of ID-Bolt service. ### 1.16.0 **Released**: September 18, 2025 #### New Features - Update of Scandit Data Capture Engine to 7.6. #### Bug Fixes - Correctly differentiate between "unknown" and "unspecified" gender. - Fixes case when user could end up with an infinite loading screen. - Fixes issue with camera switch icon disappearing after changing pages. ### 1.14.0 **Released**: August 11, 2025 #### New Features - Add option to disable closing of ID-Bolt with the browser back button. ### 1.13.0 **Released**: July 21, 2025 #### New Features - Result from ID-Bolt now contains full MRZ and VIZ result sections. - Update to Scandit Data Capture 7.4.0. #### Bug Fixes - Fixed issue where camera would not be correctly stopped after a scan end. ### 1.11.0 **Released**: July 4, 2025 #### New Features - Issuing Authority exposed in the scan result. ### 1.10.0 **Released**: June 17, 2025 #### New Features - SDC updated to 7.3.0. #### Bug Fixes - "Remote scan session expired" shows an improper error message. - "ID scanned" image not showing when imaged disabled. - Fix issues caused with very strict browser data security settings. ### 1.9.0 **Released**: June 10, 2025 #### New Features - CSS customization of buttons, links and titles is now available. #### Bug Fixes - General bug fixes and improvements. ### 1.8.0 **Released**: May 26, 2025 #### New Features - Images in the flow can now be customized. - Fonts used in the flow can now be customized. - Reduction of images throughout the flow. - New “connection status” indicator on the QR page. - When scanning a rejected document, the flow stays in the scanner screen when using newest SDK. #### Bug Fixes - Fixed an edge case in the SDK that could cause a page navigation in a callback to not execute. - Document Type not properly extracted for residence permit and health insurance card. ### 1.6.0 **Released**: April 15, 2025 #### New Features - Large assets are now delivered compressed to speed up loading times. - Comprehensive data analytics collection system. - Raw MRZ data exposed in result. - Browser history is reset to the original state when closing ID-Bolt modal. - Error screen when loading of Scandit SDK fails. - Ability to keep ID-Bolt “alive” after a successful session to retain camera permission and speed up subsequent sessions. - Updated Scandit SDK to version 7.2. #### Bug Fixes - Localization string improvements. - Translations not properly applied in certain cases. ### 1.4.0 **Released**: March 18, 2025 #### New Features - Improved Accessibility functionality. - Improved handling of connection issues during handover flow. - Using the browser back button now properly closes ID Bolt. - ID Bolt now provides a better indication of data transfer state during handover flow. - Custom data validators can now be asynchronous. #### Bug Fixes - Fixed an issue where Camera permission was asked twice on Firefox Mobile. - Fixed an error when no license key provided. ### 1.3.0 **Released**: February 18, 2025 #### New Features - Optimized data transfer speeds in hand-over flow. - Added `personalIdNumber` to result structure. #### Bug Fixes - Fixed an issue where users can get stuck in mobile flow when the welcome screen is disabled. - Removed non-functional close button in hand-over flow. - Fixed an issue where mobile flows were reported as desktop in analytics dashboard. - Disable auto-capitalization of headers. - Excluded document text override not shown when no documents excluded. ### 1.2.0 **Released**: February 5, 2025 #### New Features - Added support for new document types from WebSDK 7.x. - Support for 2-letter country codes. - Added accessibility labels to all elements of ID Bolt service. - Allow customers to provide their own translations (new languages or different strings). - Updated WebSDK to latest 7.x. #### Bug Fixes - Fixed vertical scroll bar issue in handover flow result screen. - Fixed issue with US RealID validation settings. - Fixed issue where scanner stops responding after scanning ID card/DL/Resident permit with full scanner type in handover flow. ### 1.1.0 **Released**: October 11, 2024 #### New Features - Added support for scanning ICAO Visas. - Provide more language support out of the box. - Configurability of colors of text, background and icons. - Make start guidance and result display optional. - Attribution page for OSS components. #### Bug Fixes - Fixed issue where welcome screen is still flashed once before proceeding even when disabled. - Fixed issue where welcome text is wrong when multiple same document types selected. --- ## ID Bolt session import {Redirect} from '@docusaurus/router'; --- ## Text Overrides ID Bolt allows you to customize the text displayed in the user interface to better match your application's tone, branding, or to provide more specific instructions to users. ### Using Text Overrides Text overrides are specified using the `textOverrides` option when creating an ID Bolt session: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... textOverrides: { "titles.SCANNER_HEADER": "Scan your ID for verification", "texts.HELP_SUPPORTED_DOCUMENTS_INCLUDE_LIST_BRIEF": "Please use a valid passport or driver's license", }, }); ``` ### Available Text Override Keys The following text keys can be overridden: | Key | Default | Description | Since | | --------------------------------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----- | | `titles.SCANNER_HEADER` | "Scan document" | The header of the scan screen on mobile | 1.2 | | `titles.LOCAL_SCAN_HEADER` | "Scan document" | The header of the scan screen on desktop | 1.2 | | `texts.HELP_SUPPORTED_DOCUMENTS_INCLUDE_LIST` | "Please scan a valid document. The following documents are accepted: [list of documents]" | The list of documents that are accepted, as displayed in the help screen | 1.2 | | `texts.HELP_SUPPORTED_DOCUMENTS_INCLUDE_LIST_BRIEF` | "Please scan a valid document of type [list of documents]" | A brief description of the documents that are accepted, as displayed in the main screen | 1.2 | | `texts.HELP_SUPPORTED_DOCUMENTS_EXCLUDE_LIST` | "The following documents are not accepted: [list of documents]" | The list of documents that are excluded, as displayed in the help screen. Only shown if there are excluded documents | 1.2 | ### Examples #### Customizing for Specific Use Cases ##### Example: Travel Documentation ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... textOverrides: { "titles.SCANNER_HEADER": "Scan travel document", "titles.LOCAL_SCAN_HEADER": "Scan travel document", "texts.HELP_SUPPORTED_DOCUMENTS_INCLUDE_LIST_BRIEF": "Scan passport or international ID", }, }); ``` #### Combining with Localization Text overrides should be adapted depending on the provided `locale` option to provide a fully localized experience: ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // Set the base language locale: "fr-FR", // Override specific text in that language textOverrides: { "texts.HELP_SUPPORTED_DOCUMENTS_INCLUDE_LIST_BRIEF": "Veuillez utiliser un passeport ou une carte d'identité valide", }, // other options... }); ``` --- ## Theming ID Bolt allows comprehensive customization of its visual appearance to match your brand identity. Use the `theme` option when creating an ID Bolt session to customize colors, dimensions, and other visual elements. ```ts const idBoltSession = IdBoltSession.create(ID_BOLT_URL, { // other options... theme: { colors: { primary: "#0070f3", background: "#ffffff", }, dimensions: { radiusButton: "8px", }, }, }); ``` ### Color Customization The `colors` object allows you to define colors for various UI elements: | Property | Type | Description | Since | | -------------------------------------- | -------- | ----------------------------------------------------------------------------- | ----- | | `primary` | `string` | Primary color used throughout the interface | 1.1 | | `image` | `string` | Color used for image-related elements | 1.1 | | `background` | `string` | Main popup background color | 1.1 | | `backgroundSecondary` | `string` | Secondary background color for surfaces | 1.1 | | `backgroundInverse` | `string` | Inverse background color | 1.1 | | `backgroundScannerPlaceholder` | `string` | Background color for scanner placeholder | 1.8 | | `textPrimary` | `string` | Primary text color | 1.1 | | `textSecondary` | `string` | Secondary text color | 1.1 | | `textTertiary` | `string` | Tertiary text color | 1.1 | | `textInverse` | `string` | Inverse text color | 1.1 | | `textScannerPlaceholder` | `string` | Text color for scanner placeholder | 1.8 | | `success` | `string` | Color for success states | 1.1 | | `error` | `string` | Color for error states | 1.1 | | `warning` | `string` | Color for warning states | 1.1 | | `info` | `string` | Color for informational states | 1.1 | | `buttonBackground` | `string` | Background color for buttons | 1.1 | | `buttonText` | `string` | Text color for buttons | 1.1 | | `buttonBorder` | `string` | Border color for buttons | 1.1 | | `buttonBackgroundDisabled` | `string` | Background color for disabled buttons | 1.1 | | `buttonBorderDisabled` | `string` | Border color for disabled buttons | 1.1 | | `buttonTextDisabled` | `string` | Text color for disabled buttons | 1.1 | | `connectionStatusConnectingBackground` | `string` | Background color for connection status pills in connecting/waiting state | 1.8 | | `connectionStatusConnectingText` | `string` | Text color for connection status pills in connecting/waiting state | 1.8 | | `connectionStatusSuccessBackground` | `string` | Background color for connection status pills in success state | 1.8 | | `connectionStatusSuccessText` | `string` | Text color for connection status pills in success state | 1.8 | | `connectionStatusErrorBackground` | `string` | Background color for connection status pills in error/failed state | 1.8 | | `connectionStatusErrorText` | `string` | Text color for connection status pills in error/failed state | 1.8 | | `headerButtons` | `string` | Color for the header back and close buttons (when not in their white variant) | 1.8 | | `divider` | `string` | Color for divider lines, such as the one on the QR code page | 1.8 | ### Dimension Customization The `dimensions` object allows you to customize sizes and spacing: | Property | Type | Description | Since | | -------------- | -------- | --------------------------- | ----- | | `radiusPopup` | `string` | Border radius for the popup | 1.1 | | `radiusButton` | `string` | Border radius for buttons | 1.1 | | `radiusCard` | `string` | Border radius for cards | 1.1 | All values are string and must be valid CSS dimension expressions. For example, `"12px"`. ### Image Customization Available since version `1.8`. The `images` object allows you to customize the images used in key screens: ```ts const theme = { images: { welcome: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...", flowCompleted: "data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...", acceptedId: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA...", }, }; ``` #### Image Properties | Property | Type | Description | Since | | --------------- | -------- | ------------------------------------------------------------------------------------ | ----- | | `welcome` | `string` | Image displayed on the welcome screen, both on Desktop as well as hand-over | 1.8 | | `flowCompleted` | `string` | Image displayed on the completion screen in hand-over flow | 1.8 | | `acceptedId` | `string` | Image displayed as a placeholder for an accepted image, when picture is not captured | 1.8 | #### Image Requirements - Format: PNG, JPEG, SVG, or WebP (must be provided as data URLs with appropriate mime types) - Maximum size: 50KB per image (size of the base64 data URL) - Data URL format: Must start with one of the following prefixes: - `data:image/png` - `data:image/jpeg` - `data:image/svg+xml` - `data:image/webp` ### Banner (mobile only) Available since version `2.5`. To reinforce user trust, you can display a banner at the top of ID Bolt on mobile devices. The banner supports a maximum height of 80 pixels and can be horizontally aligned to the left, center, or right. You can also define a background color, which is visible when the image does not span the full available width. :::note The banner is not displayed on non-mobile devices, where your website and branding remain visible to the user while ID Bolt is open, making a banner unnecessary. ::: ```ts const theme = { banner: { image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...", backgroundColor: "#05164d", horizontalAlignment: "left", }, }; ``` #### Banner Properties | Property | Type | Description | Since | | --------------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | | `image` | `string` | Base64 encoded image. Its height must not be larger than 80 pixels, its size must not exceed 50KB and its type should be PNG, JPEG, SVG or WebP. | 2.5 | | `backgroundColor` | `string` | CSS color to display behind the image. `transparent` by default. | 2.5 | | `horizontalAlignment` | `"left" \| "center" \| "right"` | Horizontal alignment of the image. Default is `center`. | 2.5 | #### CSS Customization of the banner If you need further customization of the banner, you can add CSS rules to `theme.styleOverrides.banner` using style overrides. Check out the [style overrides section](#style-overrides) to get more details. ### Font Customization Available since version `1.8`. The `fonts` object allows you to customize the fonts used in the interface: ```ts const theme = { fonts: { primary: { normal: "data:font/woff2;base64,d09GMgABAAAAAAT...", semibold: "data:font/woff2;base64,d09GMgABAAAAAAU...", bold: "data:font/woff2;base64,d09GMgABAAAAAAV...", }, }, }; ``` #### Font Properties | Property | Type | Description | Since | | ------------------ | -------- | --------------------------- | ----- | | `primary.normal` | `string` | Regular font weight (400) | 1.8 | | `primary.semibold` | `string` | Semi-bold font weight (600) | 1.8 | | `primary.bold` | `string` | Bold font weight (700) | 1.8 | #### Font Requirements - Format: WOFF2, WOFF, TTF, or OTF (must be provided as data URLs) - Maximum size: 100KB per font file (size of the base64 data url) - Data URL format: Must start with appropriate mime type prefixes (for example, `data:font/woff2`, `data:font/woff`) ### Style Overrides Available since version `1.9`. The `styleOverrides` object allows you to apply custom CSS to specific UI elements: ```ts const theme = { styleOverrides: { button: ` .bolt-button { display: block; width: 100%; padding: 12px 24px; background-color: #fcb700; color: #000000; text-align: center; font-weight: bold; font-size: 16px; line-height: 1.5; text-decoration: none; border: none; cursor: pointer; box-sizing: border-box; border-radius: 0; box-shadow: none; transition: background-color 0.2s ease-in-out; } .bolt-button:hover, .bolt-button:focus { background-color: #e0a800; outline: none; } `, link: ` .bolt-link { text-decoration: none; border-bottom: 1px dotted currentColor; } .bolt-link:hover { border-bottom: 1px solid currentColor; } `, title: ` .bolt-title { text-transform: uppercase; letter-spacing: 0.05em; } `, banner: ` .bolt-banner { padding-left: 10px; } `, }, }; ``` #### Available Style Override Properties | Property | Type | Description | Since | | -------- | -------- | ------------------------- | ----- | | `button` | `string` | CSS styles for buttons | 1.9 | | `link` | `string` | CSS styles for links | 1.9 | | `title` | `string` | CSS styles for titles | 1.9 | | `banner` | `string` | CSS styles for the banner | 2.5 | ##### CSS class names Use the `.bolt-button`, `.bolt-link`, `.bolt-title` and `.bolt-banner` selectors for the styling rule. You can also create additional rules for pseudo-states like `.bolt-button:hover` etc. When a style override is specified, the element is rendered in its own shadow-DOM, with the provided style sheet attached. The element will have many more CSS classes attached, but since it is rendered in a shadow DOM, these don't have an effect, unless you choose to use them in the style-override. ##### Shadow DOM When a style override is specified, the component is rendered in a shadow DOM. This means that none of the default styles of ID Bolt apply to the component anymore. Therefore, make sure to specify all relevant styles. ##### Used HTML elements Not all buttons use the ` ``` --- ## Release Notes (Web) ### 8.7.1 **Released**: November 12, 2026 #### Performance Improvements ##### Id * Optimized the capture of AAMVA documents: when no [`IdImageType.CroppedDocument`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-image-type.html#value-scandit.datacapture.id.IdImageType.CroppedDocument) image is required, the back-side scans as fast as when only scanning the back with [`SingleSideScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/physical-document-scanner.html#class-scandit.datacapture.id.SingleSideScanner). * Improved the performance of the back-side VIZ capture. ### 8.7.0 **Released**: November 5, 2026 :::warning Web SDK 8.7 is the last version that supports Safari versions earlier than 16.4, on both macOS and iOS. Starting with version 8.8, the Web SDK requires Safari 16.4 or later. See the [browser compatibility table](./system-requirements.mdx#browser-compatibility). ::: #### New Features ##### Barcode * Added structured append support to MaxiCode. The "m of n" sequencing metadata is now no longer part of the barcode data. * Changed SparkScan so that button taps no longer vibrate when haptic feedback is disabled in [`SparkScanViewSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#class-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings) * Added an AdaptiveRecognitionServiceListener that can be attached to the BarcodeCapture mode to be notified of adaptive recognition responses and errors. Each callback carries the originating frame's [`AdaptiveRecognitionFrameMetadata`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/adaptive-recognition-service-listener.html#interface-scandit.datacapture.barcode.AdaptiveRecognitionFrameMetadata) (frame ID and recognized barcodes), so an asynchronously delivered outcome can be correlated back to its frame. * Added [`BarcodeArFilter`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-ar-filter.html#interface-scandit.datacapture.barcode.ar.BarcodeArFilter) to the web SDK, letting you choose which of the currently visible barcodes MatrixScan AR presents. * Extended [`BarcodeArResponsiveAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-responsive-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArResponsiveAnnotation) to accept any [`BarcodeArAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-annotation.html#interface-scandit.datacapture.barcode.ar.ui.BarcodeArAnnotation) (info, popover, status icon, or custom) per distance state, not just [`BarcodeArInfoAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-info-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArInfoAnnotation) * Added the [`expectsOnlyUniqueBarcodes`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-ar-settings.html#property-scandit.datacapture.barcode.ar.BarcodeArSettings.ExpectsOnlyUniqueBarcodes) property to [`BarcodeArSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-ar-settings.html#class-scandit.datacapture.barcode.ar.BarcodeArSettings), matching other platforms ##### Id * Extended the ID rejection API to reject documents based on passport type with [`rejectPassportTypes`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-settings.html#property-scandit.datacapture.id.IdCaptureSettings.RejectPassportTypes), and added a new PassportType, EmergencyTravelDocument * Added [`PassportType.EmergencyTravelDocument`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/passport-type.html#value-scandit.datacapture.id.PassportType.EmergencyTravelDocument) and split PU-prefixed passport MRZs out of Emergency. The same change is now exposed on the frameworks * Added VIZ support for the front of the 2026 Alberta driver's license and of the 2026 Nebraska driver's license and ID card, including the versions for minors. * Added VIZ support for the front of the 2026 Hawaii driver's license and ID card, including the under-21 driver's license. * Added a convenience conversion from [`Region`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-region.html#enum-scandit.datacapture.id.IdCaptureRegion) to ISO code as public API * ID Validate now verifies the digital signature in the barcode of California driver's licenses and ID cards issued since October 2025. A valid signature confirms the barcode as authentic; a missing or invalid signature is reported as forged. ##### Smart Label Capture * Added multi language support to the expiry date, packaging date, weight, unit price, total price fields. At the moment, English and Spanish are supported. New languages will follow in future releases (French and German in 8.8). You can now also select a single language for your label definition, while all languages will be supported by default. * Added [`LabelCaptureSettings.settingsForSymbology()`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/label-capture-settings.html#method-scandit.datacapture.label.LabelCaptureSettings.GetSymbologySettings), so Smart Label Capture symbology settings (extensions, active symbol counts, OCR fallback regex) can be configured directly via the public API * Added the [`LabelFieldLocationType`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/label-field-location-type.html#enum-scandit.datacapture.label.LabelFieldLocationType) enum to the public exports, so it can now be imported from @scandit/web-datacapture-label ##### Core * Optimized rendering so that idle viewfinders (target aimer and laserline) no longer force a continuous render loop when nothing is animating #### Performance Improvements ##### Barcode * Improved scanning of blurry, far-away and deformed Data Matrix codes. Enabled by default on devices with FP16 support * Improved MaxiCode detection robustness for digitally generated and screen-displayed codes. * Improved PDF417 recognition of codes at low resolution and with poor print quality. * Improved the error correction capacity available to QR Model 1 codes. Damaged Model 1 codes now read more reliably. * Improved decoding accuracy on blurry and otherwise hard-to-read EAN-13 and UPC-A codes. ##### Id * Improved VIZ scanning of the Swiss passport (2022 design). * Improved VIZ scanning of ID cards and driver's licenses, so that more card designs are read correctly. Passports and visas are unchanged. ##### Core * Improved the speed of camera frame downscaling by a factor of 4/3 on ARM CPUs, most noticeably on low-end Android devices. #### Behavioral Changes ##### Barcode * Changed 1D symbology decoding to reduce false scans, at the cost of a lower scan rate on hard-to-read codes: - Reduced false scans of EAN-13/UPC-A and Code 93, and of EAN-8 and UPC-E reads inside an EAN-13/UPC-A code, in normal and strict mode. - Reduced false scans in strict mode, which now requires at least 0.75 pixels per module and decodes EAN-13/UPC-A more conservatively. - Lowered the scan rate of hard-to-read UPC-E and Code 93 codes in normal and strict mode, and of EAN-13/UPC-A, Code 128, ITF and Codabar codes in strict mode, as a cost of the false-scan reductions. * Changed GS1 decoding to reject codes that previously produced unreliable data: - Changed the GS1 DataBar Expanded reader to reject codes whose compressed item identification, weight, date or currency field holds a value the specification does not define, or whose AI 392x or 393x price has no digits, as damaged instead of producing malformed element strings. - Changed GS1 Composite decoding to reject composite codes with a damaged 2D component instead of producing a GS1 barcode with empty or malformed data. * Data Matrix: Malformed codes with invalid shift values or unhandled Upper Shift sequences are now correctly rejected as damaged rather than decoding incorrectly. * Improved QR code validation to reject improperly formatted or non-standard codes, reducing false positives and unreliable data. * Changed the Aztec reader to no longer accept a structured append header whose sequencing field is not two upper-case letters. Such symbols previously reported an invented segment index and count, for example a negative index or the third of three segments, and could be grouped into a sequence they do not belong to; their content is now decoded as ordinary message data. * Aligned which Data Matrix symbols are reported as GS1 with the Data Matrix specification: an FNC1 in any other position is a field separator and no longer sets the flag, so a symbol carrying GS1 Application Identifier data without a leading FNC1 is no longer reported as GS1; with leading-FNC1 stripping enabled the data follows the flag in both directions, so such a symbol now keeps its first FNC1 while a Structured Append symbol with an FNC1 in the fifth position now loses it. * Changed DotCode, MaxiCode and Aztec to assemble structured append sequences without a file ID (DotCode, MaxiCode modes 4 and 5, and Aztec without a message ID) into a complete buffered barcode. Their segments are grouped by symbology and segment count, so segments of two such sequences of the same length scanned within 30 seconds of each other cannot be told apart. * Changed MaxiCode modes 2 and 3 structured append segments to report their primary message fields as the file ID, and the assembled buffered barcode now holds the primary message once instead of once per segment. ##### Id * Spanish residence permits now return the NIE in both [`VIZResult.personalIdNumber`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/viz-result.html#property-scandit.datacapture.id.VizResult.PersonalIdNumber) and [`VIZResult.documentAdditionalNumber`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/viz-result.html#property-scandit.datacapture.id.VizResult.DocumentAdditionalNumber). Previously only one of the two carried it. * [`MRZResult.passportType`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.PassportType) now uses the ICAO meaning of the second letter of the MRZ document code only where it is reliable, and reports the new [`PassportType.Unknown`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/passport-type.html#value-scandit.datacapture.id.PassportType.Unknown) otherwise. Older passports from countries that used these letters differently no longer get a special type. For example, older Swiss passports with `PM` are now `National` instead of `Military`. Letters without an ICAO meaning now report `Unknown` instead of `National`. When the type is `National` or `Unknown`, nationality `XXA` gives `Stateless`, and `XXB` or `XXC` give `Refugee`. `Unknown` is only rejected if [`rejectPassportTypes`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-settings.html#property-scandit.datacapture.id.IdCaptureSettings.RejectPassportTypes) lists it. #### Bug Fixes ##### Barcode * Fixed several MaxiCode decoding and character encoding defects: - Fixed the reading of symbols where the relative size of finder pattern and module rows is slightly off relative to the specification. - Fixed corrupted characters in the data of damaged symbols that end in a truncated Numeric Shift or ECI sequence. - Fixed a crash on mode 2 and 3 symbols whose secondary message is cut off inside the `[)>RS01GS` format header. Such symbols now decode to the postal code, country code and service class followed by the truncated message. - Fixed character encoding reporting issues for ECI and MaxiCode mode 2 and 3 symbols. * Fixed several Data Matrix decoding and character encoding defects: - Fixed the GS1 flag reported by [`Barcode.isGS1DataCarrier`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode.html#property-scandit.datacapture.barcode.Barcode.IsGs1DataCarrier), which is now set by an FNC1 in the first symbol character position, or the fifth of a Structured Append symbol, as the specification defines. - Fixed the decoded value of a backtick encoded in the Text encodation scheme, which was read as an apostrophe. - Fixed several Data Matrix decoding defects related to character encoding, end-of-data handling, and shift formatting. - Fixed a Data Matrix scanning accuracy regression introduced in 8.4.0 for codes scanned with the `direct_part_marking_mode` symbology extension. * Fixed several QR decoding defects: - Fixed the reading of Model 1 codes that use data mask pattern 111. The reader accepted only seven of the eight mask patterns the standard defines for Model 1, so such codes went unrecognized. - Fixed false Structured Append results from damaged codes: a Structured Append header that is not at the start of the code, or a second one, now makes the code fail to decode instead of reporting arbitrary sequence and parity information. - Fixed decoding and flag reporting for QR codes carrying AIM Application Indicators and GS1 headers. - Fixed a QR scanning accuracy regression introduced in 8.6 for codes with degraded finder patterns (round, dotted, curved, bent, damaged) in single-barcode scanning. * Fixed several Micro QR and rectangular Micro QR (rMQR) defects: - MicroQR: Fixed an issue that prevented improvements for rotated codes and codes with cluttered backgrounds from being available in production builds. - Fixed decoding and truncation issues in Micro QR codes with invalid character counts or fully filled codewords. - Fixed the AIM Application Indicator (FNC1 in second position) of rectangular Micro QR (rMQR) codes, which is now transmitted as the two digits or the letter the specification defines instead of three digits. Codes with a reserved Application Indicator, or with an FNC1 mode indicator that is not placed right before the first data mode indicator, are now rejected, and FNC1 mode now stays in effect across later ECI headers. - Fixed a rare crash during detection of rectangular Micro QR codes whose finder pattern covers a large part of the frame, such as when scanning at very close range. * Fixed several GS1 Composite and GS1 DataBar Expanded decoding defects: - Fixed decoding errors in GS1 composite codes, such as misread lot number flag bits and dropped digits when fields are followed by additional element strings. - Removed extraneous group separators and trailing characters incorrectly appended to the decoded data of composite codes. - Fixed decoding errors in GS1 DataBar Expanded codes with AI 392x or 393x prices followed by additional element strings, such as dropped element strings or lost digits. * Fixed a false ArUco result where the inner shape of a marker was read as a second, color-inverted marker. * Fixed several Aztec decoding defects: - Fixed the file ID of an Aztec structured append symbol whose optional message ID field is absent, which was reported as the placeholder `DEFAULT`. - Fixed the character encoding reported for Aztec byte shift data that follows an ECI. * Fixed a scan regression from SDK 5.19 for 1D codes with colored backgrounds, such as dark print on a saturated label. * Fixed a rare out-of-bounds image read while detecting a code that touches the right or bottom image border. * Fixed the missing error report when a symbology's `ocr_fallback` extension is enabled without the ScanditLabelCaptureText module: the data capture context now reports a Missing Resource error naming the resources that could not be loaded, and barcode scanning continues without OCR fallback. * Fixed a bug that caused SparkScan to crash when using SmartScanSelection. * Fixed the SparkScan mini preview not being draggable. * Fixed a UI glitch when switching Selection Mode from On to Auto in BarcodeCapture. * Fixed a placement problem with [`BarcodeArStatusIconAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-status-icon-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArStatusIconAnnotation) when the barcode rotates. * Fixed BarcodeFind overwriting the zoom levels of the camera settings it was given: a [`BarcodeFindView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-find-view.html#class-scandit.datacapture.barcode.find.ui.BarcodeFindView) created with custom CameraSettings now runs on the zoom levels it was configured with. BarcodeFind's recommended camera settings now report the .5x/1x levels, matching iOS and Android. * Fixed an issue that could increase the time to scan when only QR or Data Matrix is enabled and there are more than 8 codes in the frame while using Barcode Tracking, Barcode AR, Barcode Pick, Barcode Find and Label Capture. ##### Id * Fixed the 2026 Oklahoma driver's license not returning `issuingJurisdiction` and `issuingJurisdictionIso` * Updated the bundled ID Validate model to `8.0.20260626`, which fixes valid Ohio driver's licenses (OH0901DL format) being reported as forged by ID Validate. This model was previously delivered over the air; it is now included in the SDK, so new installs use it from the first scan. * Fixed a crash when tapping the view after the ID Capture mode was removed from the data capture context. * Fixed South African driving licenses failing to scan when the barcode contains a vehicle restriction issue date without a day. * Fixed [`FullDocumentScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/physical-document-scanner.html#class-scandit.datacapture.id.FullDocumentScanner) returning no MRZ result for the US Border Crossing Card. The result now combines the VIZ and the MRZ. * Fixed IdCapture.externalTransactionId being cleared when new settings were applied. Scans after the settings change were reported without the ID. ##### Smart Label Capture * Fixed expiry and packing date fields accepting a numeric date that does not exist, such as `BEST BEFORE 32/13/2027`. Such a date is now rejected instead of being returned as the field value. * Changed the month of a captured date field to be reported with the month name as it was read from the label, in its original language and letter case, rather than a normalized lowercase English abbreviation. `10 Ene 2026` yields the month text `Ene` instead of `jan`, and the field text `10.Ene.2026` instead of `10.jan.2026`. A zero read in place of the letter `o` is still corrected, so `N0V` yields `NOV`. The numeric month is unaffected—compare against it instead of the text to branch on a month. * Fixed label capture with Data Matrix enabled stalling on the multithreaded build with the default settings. * Fixed a crash that could occur when the adaptive recognition result type was changed while a scan was still being processed * Fixed the built-in hint/notification banner (for example, the 'scanning paused' message) spanning edge-to-edge instead of staying centered when the device is in landscape orientation * Fixed expiry and packing date fields missing a date written day first with a space before the month name, such as `BEST BEFORE 25 MAR 2027`. ##### Core * Fixed the camera preview appearing shrunk with a large margin on Safari for iOS 27, caused by a WebKit regression * Fixed a crash that terminated the app when a camera frame used a pixel layout the SDK cannot convert, for example frames produced by the camera image-injection features of automated testing services. Such frames are now skipped with a warning instead * Fixed an issue where on iOS the sound was sometimes not correctly reproduced at the first scan * Updated Emscripten from 5.0.3 to 5.0.7 ### 8.6.2 **Released**: October 26, 2026 #### Bug Fixes ##### Barcode * Fixed an issue with MicroQR that prevented improvements for rotated codes and codes with cluttered backgrounds from being available in production builds. * Fixed a visual bug where dragging the SparkScan trigger button or mini preview could leave stale shadow marks on screen in Safari on iOS. * Fixed an issue that could increase the time to scan when only QR or Data Matrix is enabled and there are more than 8 codes in the frame while using Barcode Tracking, Barcode AR, Barcode Pick, Barcode Find and Label Capture. ##### Id * Fixed an issue on Safari for iOS 27 where the camera preview could appear shrunk, with a large margin around it, after the camera resumed (for example after closing a result screen). The issue was caused by a WebKit regression. ##### Core * Fixed the viewfinder becoming misaligned with the camera preview after changing the browser zoom level or resizing the window. * Updated Emscripten from 5.0.3 to 5.0.7, which fixes a pthread syscall-proxying race that could cause crashes or hangs in threaded WebAssembly builds. ### 8.6.1 **Released**: October 1, 2026 #### New Features ##### Id * Visa VIZ results for Canadian visa stickers now report the full 10-character number in [`VIZResult.visaNumber`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/viz-result.html#property-scandit.datacapture.id.VizResult.VisaNumber) (the MRZ result remains truncated). #### Bug Fixes ##### Barcode * Fixed a QR scanning accuracy regression introduced in 8.6 for codes with degraded finder patterns (round, dotted, curved, bent, damaged) in single-barcode scanning. * Rectangular Micro QR: Fixed a rare crash during detection of codes whose finder pattern covers a large part of the frame, such as when scanning at very close range. * Fixed a Data Matrix scanning accuracy regression introduced in 8.4.0 for codes scanned with the `direct_part_marking_mode` symbology extension. * Fixed Data Matrix codes not being read when their encoder ends the data with an Unlatch codeword followed by more than one pad codeword. * Fixed a 1D symbology scan regression from SDK 5.19 for codes with colored backgrounds, such as dark print on a saturated label. * Fixed SparkScan selection highlight brushes not applying until the next selection cycle. * Fixed a bug that caused SparkScan to crash when using SmartScanSelection. * Fixed the SparkScan mini preview not being draggable. * Fixed the barcode duplicate filter explicitly set to -2 under SelectionMode On not being respected and being incorrectly relaxed to 0. * Fixed MatrixScan AR info annotations so that replacing a header, footer, icon or body replaces it instead of adding a second one, and setting it to null removes it. [`BarcodeArPopoverAnnotationButton.text`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-popover-annotation.html#property-scandit.datacapture.barcode.ar.ui.BarcodeArPopoverAnnotationButton.Text) now returns the button's label instead of an empty string. * Fixed a placement problem with [`BarcodeArStatusIconAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-status-icon-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArStatusIconAnnotation) when the barcode rotates. * Fixed [`BarcodeArAnnotationAnchor`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-annotation.html#enum-scandit.datacapture.barcode.ar.ui.BarcodeArAnnotationAnchor) not being available at runtime, which made a custom BarcodeAr annotation ignore its anchor. The default placement now also matches native, above the tracked barcode instead of below it. * Fixed BarcodeFind overwriting the zoom levels of the camera settings it was given: a [`BarcodeFindView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-find-view.html#class-scandit.datacapture.barcode.find.ui.BarcodeFindView) created with custom CameraSettings now runs on the zoom levels it was configured with. BarcodeFind's recommended camera settings now report the .5x/1x levels, matching iOS and Android. ##### Id * Fixed the 2026 Oklahoma driver's license not returning the Jurisdiction and JurisdictionIso fields. * Updated the bundled ID Validate model to `8.0.20260626`, which fixes valid Ohio driver's licenses (OH0901DL format) being reported as forged by ID Validate. This model was previously delivered over the air; it is now included in the SDK, so new installs use it from the first scan. ##### Core * Fixed scanning silently stopping after the browser released the page's WebGL context, while the camera preview kept rendering. * Fixed a crash that terminated the app when a camera frame used a pixel layout the SDK cannot convert, for example frames produced by the camera image-injection features of automated testing services. Such frames are now skipped with a warning instead. * Fixed ScanditIcon not rendering a background stroke by default when a background shape and stroke color were both configured, matching iOS and Android. ### 8.6.0 **Released**: August 31, 2026 #### New Features ##### Barcode * [`BarcodeArResponsiveAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-responsive-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArResponsiveAnnotation) now takes a map of distance thresholds to annotations, so a barcode can show a different annotation at any number of distances instead of only close-up and far-away. The previous two-state API is deprecated, see Deprecations below. * Extended BarcodeBatch on Android so that setting the overlay brush to null clears the highlights of tracked barcodes, matching iOS. * Extended the support for DotCode features by adding support for: - Extended Channel Interpretation (ECI). Symbols that switch character sets (for example to Cyrillic or another code page) now report the correct per-segment encoding. As part of this, the default character set for DotCode is now reported as ISO 8859-1 instead of ASCII. - Message envelopes as defined in ISO/IEC 15434. - Structured append. DotCode has no file ID, so segments are not automatically grouped by the buffered barcode session. ##### Id * Visa MRZ results now report country-specific additional details such as [`MRZResult.visaNumber`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.VisaNumber), [`MRZResult.visaNumberOfEntries`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.VisaNumberOfEntries), [`MRZResult.visaMultipleEntries`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.VisaMultipleEntries) and [`MRZResult.visaDurationInDays`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.VisaDurationInDays). * Extended the VizDocumentScanner sanitizer restriction to run all sanitizers for front-and-back captures and only reject on front-only captures, so front-side VIZ field corrections are no longer lost in double-sided captures. ##### Smart Label Capture * Restored SIMD support in WebAssembly for iOS 26, recovering performance across all capture modes, most noticeably Label Capture. * [BETA] Added shipping-label support ([`AdaptiveRecognitionResultType.ShippingLabel`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/adaptive-recognition-result-type.html#value-scandit.datacapture.label.AdaptiveRecognitionResultType.ShippingLabel), [`Carrier`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/carrier.html#enum-scandit.datacapture.label.Carrier), [`ShippingLabelScanningResult`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/shipping-label-scanning-result.html#class-scandit.datacapture.label.ShippingLabelScanningResult)) to adaptive recognition. * Added a new sample to quickly test and integrate Smart Label Capture to read and validate price shelf labels against a database - showing live AR overlays based on the match and mismatch of the content. * Added support for label definitions that use the "semantics" feature on fields of both type "barcode" and "text" simultaneously; previously only one of the two types could use it at once. ##### Core * Added support in the GS1 parser for the telecom Application Identifiers 8040 (IMEI), 8041 (IMEI2), 8042 (eSIM/EID), and 8043 (pSIM), so GS1 codes carrying them parse instead of being rejected as unrecognized. * Added support for parsing the 2D-DOC (French 2D-Doc / ANTS) data format. * Added more detailed error reporting when required resources are missing. * Added HTTPS as the default protocol for SDK samples, so you can open and test a sample directly on a device without setting up an HTTPS tunnel. * Added the [`DataCaptureView.setProperty`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/data-capture-view.html#method-scandit.datacapture.core.ui.DataCaptureView.SetProperty) method. * Added [`CameraSwitchControl.behavior`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/camera-switch-control.html#property-scandit.datacapture.core.ui.CameraSwitchControl.Behavior) to choose between cycling through all cameras (Cycle) or flipping between front and back (Flip). * Added a default camera frame rate cap of 30 fps, configurable via CameraSettings.maxFrameRate. * Added LicenseInfo.allowedModes, exposing the set of capture modes a license key permits via the new CaptureMode enum. * Added [`Camera.getAllWithPermissionState()`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera.html#method-scandit.datacapture.core.Camera.GetAllWithPermissionState), which returns the available cameras together with the current camera PermissionState (granted, denied, or prompt). This lets you distinguish an empty camera list caused by the absence of cameras on the device from one caused by the user denying camera access. * Added a UMD build alongside the ESM build. * Added support for reading camera frames directly into a SharedArrayBuffer in supported environments (currently Chrome or Firefox, when pthread is enabled), avoiding an extra copy. #### Performance Improvements ##### Barcode * Reduced the false positive rate for EAN13, UPCA, EAN8, and UPC-E. * Improved ITF decoding robustness, reducing the number of unscanned codes. On our internal datasets, we measured an improvement of more than 20% true positives. * Improved MicroQR decoding for rotated codes and cluttered backgrounds. On our internal datasets, we measured an improvement of more than 40% true positives. ##### Id * Improved PDF417 scanning on Quebec, Alaska, and Oklahoma driver’s licenses. #### Behavioral Changes ##### Barcode * Changed the default highlight brush in SparkScan and Barcode Capture. * Updated recommended camera settings for MatrixScan Batch, Find, Pick, Sequence, and AR, now using UHD4K resolution with a 16:9 aspect ratio. * Enabled detection and decoding of mirrored MaxiCodes by default. Previously this required enabling the symbology extension `mirrored`, which has been removed. * Limited the GS1 format flag for DotCode to genuine GS1 openings (a leading digit pair without FNC1) per AIM DotCode v3.0, instead of defaulting all symbols to GS1. * Disabled enhanced low-resolution scanning of QR codes (introduced in 8.5.0) for MatrixScan modes. Customers who need this feature should contact Scandit support. #### Bug Fixes ##### Barcode * Fixed rare cases where DotCode Code Set C symbols using the date/lot macro decoded to incorrect data due to a dropped leading zero in a digit pair. * Fixed a regression where short ITF codes with low wide/narrow ratio were not decoded. ##### Id * Improved the DLID parser, fixing previously unparsable codes found in analytics. * Resolved a duplicate Objective-C class registration that could trigger spurious casting failures or crashes when an app links both ScanditCaptureCore and ScanditIdCapture. ##### Smart Label Capture * Fixed a bug where the receipt scanning overlay and validation flow overlay could not be used on the same mode instance. * Fixed several LabelCapture debug-app scenarios (Point To Scan - Dates, EU Driver License Back Side, Mixed Semantics) that failed to scan. * Fixed prebuilt date fields to recognize Spanish month abbreviations. The abbreviations `ene`, `abr`, `ago`, and `dic` are newly supported; the remaining Spanish abbreviations already resolved because they match their English form. The expiry-date anchor additionally recognizes common Spanish expiry terms such as `caducidad`, `vencimiento`, `consumir antes`, and `consumo preferente`. ##### Core * Fixed a SequenceFrameSource occasionally delivering the same frame to its listeners twice. * Fixed a race condition in SimplePropertyBehaviorSubject where mutating the subscriber list during a callback could cause crashes or missed notifications. * Fixed a crash when the Scandit analytics server returned an out-of-range retry timeout. * Fixed pinch-to-zoom and swipe-to-zoom becoming unresponsive after the browser interrupted a touch gesture, and duplicated tap and zoom handling after a data capture view was re-attached. * Fixed a memory leak that could make the browser tab run out of memory and crash when the data capture context was disposed and created again repeatedly. #### Deprecations ##### Barcode * Deprecated the two-state [`BarcodeArResponsiveAnnotation`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-responsive-annotation.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArResponsiveAnnotation) API in favor of a new configurable annotationsByThreshold map that supports more than two distance states; the previous two-state API remains available. ### 8.5.5 **Released**: October 29, 2026 #### Bug Fixes ##### Barcode * Fixed a Data Matrix scanning accuracy regression introduced in 8.4.0 for codes scanned with the `direct_part_marking_mode` symbology extension. ##### Core * Fixed an issue on Safari for iOS 27 where the camera preview could appear shrunk, with a large margin around it, after the camera resumed (for example after closing a result screen). The issue was caused by a WebKit regression. * Updated Emscripten from 5.0.3 to 5.0.7, which fixes a pthread syscall-proxying race that could cause crashes or hangs in threaded WebAssembly builds. ### 8.5.4 **Released**: October 19, 2026 #### Bug Fixes ##### Id * Updated the bundled ID Validate model to `8.0.20260626`, which fixes valid Ohio driver's licenses (OH0901DL format) being reported as forged by IdValidate. This model was previously delivered over the air; it is now included in the SDK, so new installs use it from the first scan. ### 8.5.3 **Released**: August 18, 2026 #### Behavioral Changes ##### Barcode * Disabled enhanced low-resolution scanning of QR codes (introduced in 8.5.0) for MatrixScan modes. Customers who need this feature should contact Scandit support. ### 8.5.2 **Released**: July 31, 2026 #### Performance Improvements ##### Id * Improved performance of Irish Garda Age Card ### 8.5.1 **Released**: July 20, 2026 #### Performance Improvements ##### Core * Re-enabled SIMD support in WebAssembly for iOS 26. Restores performance in all capture modes, noticeably Label Capture. #### Bug Fixes ##### Barcode * Fixed BarcodeCapture and SparkScan not applying a selectionMode change from On to Auto, which left the aimer visible. ##### Id * Fixed an incorrect license key check that prevented scanning of documents with a PDF417 barcode or MRZ on one side, and of mDLs read via OCR. ### 8.5.0 **Released**: July 9, 2026 #### New Features ##### Barcode * Added the SelectionMode API to replace the SparkScan target-mode APIs and [`ScanIntention.SmartSelection`](https://docs.scandit.com/data-capture-sdk/web/core/api/scan-intention.html#value-scandit.datacapture.core.ScanIntention.SmartSelection): Set `selectionMode` (off/on/auto) in the [`BarcodeCaptureSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-capture-settings.html#class-scandit.datacapture.barcode.BarcodeCaptureSettings) and [`SparkScanSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-settings.html#class-scandit.datacapture.barcode.spark.SparkScanSettings) to control whether an aimed-at barcode is scanned automatically or requires explicit selection. * Added `logoStyle` and `logoAnchor` customization properties to [`BarcodeArView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-view.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArView), `BarcodeCountView`, [`BarcodeFindView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-find-view.html#class-scandit.datacapture.barcode.find.ui.BarcodeFindView), `BarcodePickView`, and `BarcodeSequenceView`. ##### Id * Added Irish Garda Age Card as [`RegionSpecificSubtype.IrelandAgeCard`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/region-specific-subtype.html#value-scandit.datacapture.id.RegionSpecificSubtype.IrelandAgeCard). * Added a new [`PassportType`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/passport-type.html#enum-scandit.datacapture.id.PassportType) property to [`MRZResult`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#class-scandit.datacapture.id.MrzResult). * Added double-sided support for the Oman residence card. * Added single-sided support for extraction of issue date and birth date from the 2025 NYC Municipal ID. * Added Web support for: Australia ACT Driver's License, USA Oklahoma Driver's License, and USA Puerto Rico ID. ##### Smart Label Capture * Extended VIN label capture to also scan Code 128 barcodes (in addition to QR, Code 39, and Data Matrix) via [`createVinLabelDefinition()`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/label-definition.html#method-scandit.datacapture.label.LabelDefinition.VinLabelDefinitionWithName). * Extended LabelCapture to accept label definitions where both "barcode" and "text" field types use the "semantics" feature simultaneously; previously this was restricted to only one field type at a time. * Improved the add/remove lifecycle handling of the validation flow overlay. #### Performance Improvements ##### Barcode * Enhanced detection of low-resolution QR codes, improving scan rates for QR codes with degraded print quality or unfavorable capture conditions. This improvement applies to QR codes of versions 1, 2, and 3 (21×21, 25×25, and 29×29 modules). - codes is now enabled by default, improving scan rates for challenging QR codes with degraded print quality or unfavorable capture conditions. This improvement applies to QR codes of versions 1, 2, and 3 (21×21, 25×25, and 29×29 modules). * Improved scanning of micro-QR codes affected by quiet zone violations and perspective distortion. ##### Smart Label Capture * Improved Receipt Scanning efficiency by optimizing receipt image processing before extraction. ##### Core * Improved worker loading. #### Behavioral Changes ##### Barcode * Reduced Code 128 minimum symbol count from 6 to 4; short codes (4 & 5 symbols) use stricter matching rules than longer codes. To explicitly exclude short codes, disable symbol counts 4 & 5 via [`SymbologySettings.activeSymbolCounts`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/symbology-settings.html#property-scandit.datacapture.barcode.SymbologySettings.ActiveSymbolCounts) for Code 128. Note that if you previously enabled short code scanning, more strict settings are now in effect to reduce the chance of false positives, which are more likely for very short codes. * Tightened Code 39 false positive filter thresholds by default; to restore the previous behavior, enable the `relaxed` extension on Code 39 via [`SymbologySettings.setExtensionEnabled()`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/symbology-settings.html#method-scandit.datacapture.barcode.SymbologySettings.SetExtensionEnabled). This is only advised when external validation measures are available, for example, scanning against a known list of valid codes or when codes contain structured data. * Updated [`SymbologyDescription.forIdentifier`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/symbology-description.html#method-scandit.datacapture.barcode.SymbologyDescription.ForIdentifier) to return `null` for unrecognized identifiers (for example, `"EAN-8"` instead of `"ean8"`); previously such input was silently mapped to `Codabar`. #### Bug Fixes ##### Barcode * Fixed a memory leak in item-based scanning. * Fixed [`BarcodeArViewSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-view-settings.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArViewSettings) not being taken into account. * Fixed the camera settings recommended by [`BarcodeAr.createRecommendedCameraSettings()`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-ar.html#method-scandit.datacapture.barcode.ar.BarcodeAr.CreateRecommendedCameraSettings) not being applied correctly. * Fixed a [`BarcodeFind`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-find.html#class-scandit.datacapture.barcode.find.BarcodeFind) view issue where overlay dots were sometimes not rendered correctly after pausing. * Fixed PDF417 macro block file ID decoding to correctly handle numeric formatting according to the ISO/IEC 15438:2015 specification. * Fixed rare cases of incorrect (tiny) PDF417 location outlines. ##### Id * Fixed an issue where cropped document images were rotated when Frame Image was also enabled. * Corrected the orientation of cropped Visa document images that were being rotated incorrectly when scanned using a single-frame image source. * Fixed parser handling of non-standard Surrey BC AAMVA barcodes that were incorrectly returning "Invalid Format." * Resolved a duplicate Objective-C class registration that could trigger spurious casting failures or crashes when an app links both ScanditCaptureCore and ScanditIdCapture. ##### Smart Label Capture * Fixed a memory leak in LabelCapture. ##### Core * Fixed the Web SDK camera preview expanding to full-screen in iOS WebViews by setting `playsinline` and `webkit-playsinline` attributes on the video element; the host `WKWebView` must also enable `allowsInlineMediaPlayback`. * Fixed a bug that caused the zoom notification to not be shown when using the [`ZoomSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-switch-control.html#class-scandit.datacapture.core.ui.ZoomSwitchControl). * Fixed a crash when the [`DataCaptureContext`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext) singleton was initialized more than once. * Fixed an issue that caused the torch to turn off after minimizing the browser or switching tabs. #### Deprecations ##### Barcode * The SparkScan target-mode APIs and [`ScanIntention.SmartSelection`](https://docs.scandit.com/data-capture-sdk/web/core/api/scan-intention.html#value-scandit.datacapture.core.ScanIntention.SmartSelection) are deprecated in favour of selectionMode. ### 8.4.2 **Released**: September 28, 2026 #### Performance Improvements ##### Core * Re-enabled SIMD support in WebAssembly for iOS 26, restoring performance in all capture modes, most noticeably Label Capture. #### Bug Fixes ##### Barcode * Fixed a Data Matrix scanning accuracy regression introduced in 8.4.0 for codes scanned with the `direct_part_marking_mode` symbology extension. ##### Id * Updated the bundled ID Validate model to `8.0.20260626`, which fixes valid Ohio driver's licenses (OH0901DL format) being reported as forged by ID Validate. This model was previously delivered over the air; it is now included in the SDK, so new installs use it from the first scan. ### 8.4.1 **Released**: June 23, 2026 #### Bug Fixes ##### Barcode * Fixed [`BarcodeArViewSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-view-settings.html#class-scandit.datacapture.barcode.ar.ui.BarcodeArViewSettings) not being taken into account. * Fixed the camera settings recommended by [`BarcodeAr.createRecommendedCameraSettings()`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/barcode-ar.html#method-scandit.datacapture.barcode.ar.BarcodeAr.CreateRecommendedCameraSettings) not being applied correctly. * Fixed a memory leak in SparkScan when using the item-based API. ##### Id * Fixed an issue where cropped document images were rotated when they are recovered using the [`getFrame`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-images.html#method-scandit.datacapture.id.IdImages.GetFrame) API. ##### Core * Fixed WebKit 26.x bugs causing pthreads WASM crashes (WebKit bug #303387) and SIMD corruption on affected versions (Apple Radar 176035764) by pinning memory and disabling SIMD engine-wide. This slows compute-heavy scanning on those versions, most noticeably Label Capture OCR. ### 8.4.0 **Released**: May 18, 2026 #### New Features ##### Barcode * Added `dotRadius` property to [`BarcodeBatchBasicOverlay`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-batch-basic-overlay.html#class-scandit.datacapture.barcode.batch.ui.BarcodeBatchBasicOverlay) to allow customizing the size of dots when using the Dot overlay style. ##### Id * Added support for reading the vehicle table on the back of New Zealand driving licences, with the latest expiry date returned; supported vehicle classes are 1–6, including L=learner and R=restricted variants. * Added support for new versions of USA, California–Driver's License; USA, North Carolina–Driver's License; USA, Texas–Driver's License; and USA, Oklahoma–Driver's License. ##### Smart Label Capture * Added the `numberOfMandatoryInstances` property to the Web platform. ##### Core * Redesigned [`ZoomSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-switch-control.html#class-scandit.datacapture.core.ui.ZoomSwitchControl) to support multiple configurable zoom levels; the control now displays as a compact button that expands to show all available zoom levels, automatically filtered to those supported by the device hardware. * Added a new [`PinchToZoom`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-gesture.html#class-scandit.datacapture.core.ui.PinchToZoom) gesture. * Introduced a new [`ZoomListener`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera.html#interface-scandit.datacapture.core.ZoomListener) on the Camera object. * Added support for the [`SwipeToZoom`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-gesture.html#class-scandit.datacapture.core.ui.SwipeToZoom) gesture. * Added a default value to the [`ZoomSwitchOrientation`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-switch-orientation.html#enum-scandit.datacapture.core.ui.ZoomSwitchOrientation) enum. * Adjusted control colors for better visibility on dark and light backgrounds. * Fixed a bug where sound feedback was not correctly played in a multi-tab scenario. #### Performance Improvements ##### Barcode * Improved Code 128 scan robustness for codes with uneven blur and geometric distortions. Available on all platforms except WebAssembly without SIMD and ARM without FP16. * Improved 1D barcode scanning speed and reduced false positives for linear symbologies. * Further improved scanning of square DataMatrix codes with damaged or occluded timing patterns. ##### Core * Improved worker loading. #### Behavioral Changes ##### Barcode * Smart Scan Intention now continuously adapts between Single Scan and Selection modes during a scanning session when Smart Scan Selection is enabled, switching back to Single Scan when the scene no longer requires Selection mode. Previously, once Selection mode was activated it remained active for the rest of the session. * Changed ITF scanning to reduce false positives by introducing checksum-dependent scoring. ITF has an optional checksum which is mandated to be enabled by many of the standards that use ITF as the data carrier. Starting with this release, checksum-passing ITF codes are scanned with more relaxed conditions than codes that don't pass the checksum test. This happens even if the optional mod 10 checksum isn't enabled. To disable this behavior, enable the `no_checksum_dependent_validation` symbology extension for the ITF symbology. * Removed the Abseil library dependency. * Reduced Code 39 false positives. ##### Core * Updated mbedtls from version 3.6.5 to 3.6.6. * Updated the [`CameraSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/camera-switch-control.html#class-scandit.datacapture.core.ui.CameraSwitchControl) and [`TorchSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/torch-switch-control.html#class-scandit.datacapture.core.ui.TorchSwitchControl) UI. #### Bug Fixes ##### Barcode * Fixed an issue where zoom notifications were not shown when zooming in and out. * Fixed an issue causing the SparkScan mini preview to have an incorrect size in landscape orientation. * Fixed an issue that caused the SparkScan camera to stop working when disposing the context and re-initializing it. * Fixed PDF417 macro block file ID decoding to correctly handle numeric formatting according to the ISO/IEC 15438:2015 specification. * Fixed a crash that could occur when scanning barcodes with the k-out-of-n filter enabled, if some detected barcodes were not subject to filtering. * Fixed an issue where the Smart Scan Selection aimer would become too small when scan-area margins restricted the visible scan area; the aimer is now sized relative to the view, keeping a consistent on-screen size regardless of margins. ##### Id * Fixed an issue where the US Permanent Residence Card was not processed through the VizMrz flow. * Fixed an issue with browsers that don't support `createImageBitmap` in ID Capture. * Fixed an issue where AAMVA verification was being performed even when no AAMVA document types were enabled in the accepted documents. ##### Smart Label Capture * Fixed a memory leak in LabelCapture * Fixed an issue where the validation flow viewfinder was not displayed. * Fixed a race condition in the validation flow. * Fixed an issue where adaptive scanning text was sometimes not correctly shown in the validation flow overlay. * Fixed a bug in the validation flow where input was not fully visible when focused in landscape orientation. * Fixed a bug that caused error messages in [`DataCaptureView`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/data-capture-view.html#class-scandit.datacapture.core.ui.DataCaptureView) to be rendered partially out-of-view. * Fixed a rare race condition in Label Capture. * Added `.asDate()` support to `ExpiryDate` and `PackingDate` label fields when the text is provided as manual input or as an Adaptive-Recognition-Engine response. * Fixed a bug where the receipt scanning overlay and validation flow overlay could not be used on the same LabelCapture mode instance. ##### Core * Fixed a crash that occurred when the [`DataCaptureContext`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext) singleton was initialized more than once. * Fixed a bug where setting the same [`DataCaptureContext`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext) instance twice on a [`DataCaptureView`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/data-capture-view.html#class-scandit.datacapture.core.ui.DataCaptureView) would lead to a crash. #### Deprecations ##### Core * Added [`zoomLevels`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera-settings.html#property-scandit.datacapture.core.CameraSettings.ZoomLevels) property to [`CameraSettings`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera-settings.html#class-scandit.datacapture.core.CameraSettings) and deprecated [`zoomGestureZoomFactor`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera-settings.html#property-scandit.datacapture.core.CameraSettings.ZoomGestureZoomFactor). * Deprecated [`CameraFOVSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/camera-fov-switch-control.html#class-scandit.datacapture.core.ui.CameraFOVSwitchControl) in favor of [`ZoomSwitchControl`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/zoom-switch-control.html#class-scandit.datacapture.core.ui.ZoomSwitchControl). ### 8.3.1 **Released**: April 14, 2026 #### Bug Fixes ##### Id * Fixed an issue with browsers that don't support `createImageBitmap` in ID Capture ##### Smart Label Capture * Fixed the validation flow to accept dates in more formats when manually entered * Fixed a race condition in the validation flow ##### Core * Fixed JavaScript syntax in the sdc-lib folder that was not correctly downleveled to respect the minimum browser version ### 8.3.0 **Released**: March 26, 2026 #### New Features ##### Barcode * Added support for composite codes in SparkScan ##### Id * Corrected Mexican Voter ID parent names to firstName and lastName * Added support for OCR scanning of the 2026 version of Victoria mobile driver licenses * Added [`IdCaptureSettings.anonymizeDefaultFields`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-settings.html#property-scandit.datacapture.id.IdCaptureSettings.AnonymizeDefaultFields) setting that controls whether the SDK applies default anonymization rules for specific document types and regions * US, EU/ Schengen + UK passports no longer fallback to MRZ only. Now, US, EU/ Schengen + UK passports must capture VIZ instead of returning MRZ values after the configurable timeout has elapsed. This applies to [`FullDocumentScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/physical-document-scanner.html#class-scandit.datacapture.id.FullDocumentScanner) or [`SingleSideScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/physical-document-scanner.html#class-scandit.datacapture.id.SingleSideScanner) when both VIZ and MRZ zones are enabled. ##### Smart Label Capture * Fixed a rare race condition * Fixed some issues with keyboard handling in Validation Flow #### Performance Improvements ##### Barcode * Improved EAN8 false positive filtering in strict mode * Improved speed of MatrixScan Count scanning phase for mid- and high-end devices #### Bug Fixes ##### Barcode * Fixed an issue that caused the SparkScan camera to stop working when disposing the context and re-initializing it. * Fixed an issue causing the SparkScan toolbar buttons to be aligned incorrectly. ##### Id * Fixed BarcodeDictionary anonymization setting for iOS and Web * Fixed support for UAE Esaad card * Sanitized name fields on ACT driver license to split FullName and populate first and last name properties * Added support for scanning MRZ from the back of Argentinian DN when using [`FullDocumentScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/physical-document-scanner.html#class-scandit.datacapture.id.FullDocumentScanner) * Fixed misplaced MRZ anonymization on FullFrame images. ##### Smart Label Capture * Fixed issue where the [`LabelCaptureValidationFlowOverlay`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/ui/label-capture-validation-flow-overlay.html#class-scandit.datacapture.label.ui.LabelCaptureValidationFlowOverlay) sometimes did not reflect label capture settings when reused * Enhanced the [`LabelCaptureValidationFlowOverlay`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/ui/label-capture-validation-flow-overlay.html#class-scandit.datacapture.label.ui.LabelCaptureValidationFlowOverlay) to resume when the mode is enabled and Validation Flow is paused. * Fixed camera being incorrectly paused while cloud backup started in Validation Flow * Fixed runtime error that sometimes occurred during cloud backup request when screen was tapped in validation flow ##### Core * Fixed sound feedback playback in multi-tab scenarios * Fixed a potential app hang when the app transitions to the background for licenses without analytics enabled. ### 8.2.1 **Released**: March 5, 2026 #### Bug Fixes ##### Id * Corrected Mexican Voter ID parent names to map to firstName and lastName * Sanitized name fields on ACT DL. Splits FullName to populate first and last name properties ##### Smart Label Capture * Fixed [`LabelCaptureValidationFlowOverlay`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/ui/label-capture-validation-flow-overlay.html#class-scandit.datacapture.label.ui.LabelCaptureValidationFlowOverlay) not reflecting Label Capture settings if reused * Fixed [`LabelCaptureValidationFlowOverlay`](https://docs.scandit.com/data-capture-sdk/web/label-capture/api/ui/label-capture-validation-flow-overlay.html#class-scandit.datacapture.label.ui.LabelCaptureValidationFlowOverlay) not correctly resuming if user changes view when in pause and comes back * Fixed some issues with keyboard handling in Validation Flow * Fixed camera being incorrectly paused while cloud backup started in Validation Flow * Fixed runtime error thrown in Validation Flow when screen was tapped while a cloud backup request was running * Fixed a rare race condition ### 8.2.0 **Released**: February 13, 2026 #### New Features ##### Barcode * Stopped emitting vibration feedbacks when the scanner is stopped without user interaction ##### Id * Enabled scanning of MRZ on the backside of several EU residence permits * Added extraction of a cropped document image from Passports and VISAs that do not support VIZ extraction * Added extraction of the date of birth from Romanian IDs ##### Smart Label Capture * The Validation Flow, our ready‑to‑use workflow in Smart Label Capture for capturing and validating label data with minimal code, now features a completely redesigned user interface. The update improves ergonomics through a simplified API and highly requested customization options, making Smart Label Capture more intuitive and significantly reducing integration and customization effort across a wider range of use cases ##### Core * Removed Howler.hs and JavaScript Cookie third-party dependencies #### Performance Improvements ##### Core * Reduced intermittent memory spikes while configuring the barcode scanner across all capture modes #### Bug Fixes ##### Barcode * Improved the Smart Scan Intention logic for detecting main codes + five-digit add on codes. This improves the rate of complete main + add-on code pairs. * Fixed a bug where the torch control would be shown even if the torch was not supported * Fixed an issue where SparkScan would select the wrong camera * Fixed an issue where the [`SparkScanView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView) was not being disposed correctly ##### Id * Treated Puerto Rico driver licenses as AAMVA to enforce barcode capture with FullScanner * Fixed a bug that would cause Canada Northwest Territories driver license scans to be incomplete ##### Core * Fixed an issue where in some webview scenarios the wrong back camera was selected on the iPhone Pro #### Deprecations ##### Smart Label Capture * Deprecated some LabelCaptureValidationFlowSetting APIs: requiredFieldErrorText, missingFieldsHintText, manualInputButtonText, as those don't make sense anymore with the redesign of Validation Flow in 8.2 ### 8.1.7 **Released**: October 7, 2026 No updates for this framework in this release. ### 8.1.6 **Released**: July 29, 2026 No updates for this framework in this release. ### 8.1.5 **Released**: June 10, 2026 #### Bug Fixes ##### Barcode * Fixed a memory leak in item-based scanning. ##### Smart Label Capture * Fixed a memory leak in LabelCapture. ### 8.1.4 **Released**: April 21, 2026 #### Bug Fixes ##### Barcode * Fixed a crash that could occur when scanning barcodes with the k-out-of-n filter enabled, if some detected barcodes were not subject to filtering. * Fixed a crash that occurred when the [`DataCaptureContext`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext) singleton was initialized more than once. ##### Id * Fixed an issue with browsers that don't support `createImageBitmap` in ID Capture. ### 8.1.3 **Released**: March 25, 2026 #### Bug Fixes ##### Core * Fixed a potential app hang when the app transitions to the background for licenses without analytics enabled. * Fixed syntax in JavaScript sdc-lib folder not correctly downleveled to respect minimum browser version. ### 8.1.2 **Released**: March 9, 2026 #### Bug Fixes ##### Barcode * Fixed an issue where SparkScan would select the wrong camera ##### Smart Label Capture * Fixed a rare race condition ##### Core * Fixed an issue where in some webview scenarios on iPhone Pro the wrong back camera was selected ### 8.1.1 **Released**: February 5, 2026 #### Performance Improvements ##### Core * Reduced intermittent memory spikes while configuring the barcode scanner across all capture modes #### Bug Fixes ##### Barcode * Fixed an issue where the [`SparkScanView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView) was not being disposed correctly ##### Id * Removed the Centaurus dependency from the ID Capture package which was accidentally added in 8.1.0 but never actually used ### 8.1.0 **Released**: December 17, 2025 #### New Features ##### Barcode * Smart Scan Selection is now available in Barcode Capture. Scanning a single barcode is often difficult in environments where multiple barcodes are placed closely together, like on a densely packed warehouse shelf or on a package with various labels. This can lead to scanning the wrong item, causing errors and slowing down operations. Smart Scan Selection solves this problem by automatically detecting when a user is trying to scan in a "dense barcode" environment. The interface then intelligently adapts, providing an aimer to help the user precisely select the desired barcode without needing to manually change any settings. This creates a more intuitive scanning experience that requires no manual configuration. * Added [`SymbologySettings.ocrFallbackRegex`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/symbology-settings.html#property-scandit.datacapture.barcode.SymbologySettings.OcrFallbackRegex), allowing you to filter or constrain results returned from OCR fallback. * Extended Aztec codes reader to support scanning mirrored codes. * Added support for square DataMatrix codes with one-sided damage or occlusion. This feature is only enabled in Barcode Capture and SparkScan. * [SparkScan](/sdks/web/sparkscan/intro.md) now supports Smart Scan Selection. Scanning a single barcode is often difficult in environments where multiple barcodes are placed closely together, like on a densely packed warehouse shelf or on a package with various labels. This can lead to scanning the wrong item, causing errors and slowing down operations. Users might have to manually switch to a special, more precise scanning mode (Target Mode), which is inefficient. Smart Scan Selection solves this problem by automatically detecting when a user is trying to scan in a "dense barcode" environment. The interface then intelligently adapts, providing an aimer to help the user precisely select the desired barcode without needing to manually change any settings. This creates a more intuitive scanning experience that requires no manual configuration. * Added [`ScanditIconType.Delete`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/scandit-icon.html#value-scandit.datacapture.core.ui.ScanditIconType.Delete) and [`ScanditIconType.Slash`](https://docs.scandit.com/data-capture-sdk/web/core/api/ui/scandit-icon.html#value-scandit.datacapture.core.ui.ScanditIconType.Slash) which can be used in [`BarcodeArStatusIconAnnotationAnchor`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-status-icon-annotation.html#enum-scandit.datacapture.barcode.ar.ui.BarcodeArStatusIconAnnotationAnchor). ##### Id * Added NationalityISO property that maps results from Nationality field to country ISO code * Added RejectionDiagnosticJSON property to CapturedId to report debug info during Timeout rejections * Added [`rejectionTimeoutSeconds`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-settings.html#property-scandit.datacapture.id.IdCaptureSettings.RejectionTimeoutSeconds) to [`IdCaptureSettings`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture-settings.html#class-scandit.datacapture.id.IdCaptureSettings) allowing customers to use timeout other than default (6 s). Minimum timeout is 1 s. * Added support for new California DL, new South Carolina DL, Arizona Medical Marijuana Card, Kuwait Civil card, and new Texas DL ##### Core * Added Electronic Product Code (EPC) parser and GS1_DIGITAL_LINK parsers #### Performance Improvements ##### Barcode * Improved MicroQR detector tolerance to quiet zone violations * Improved suppression of incorrect Codabar recognitions when using the [“strict" symbology extension](../symbology-properties#symbology-extension-descriptions) ##### Id * Improved success rate when scanning using the [`ImageFrameSource`](https://docs.scandit.com/data-capture-sdk/web/core/api/image-frame-source.html#class-scandit.datacapture.core.ImageFrameSource) or the [`SingleImageUploader`](https://docs.scandit.com/data-capture-sdk/web/core/api/web/single-image-uploader.html#class-scandit.datacapture.core.SingleImageUploader) as frame source ##### Smart Label Capture * Incremental improvements in accuracy across all use-cases for the OCR model powering Smart Label Capture. #### Behavioral Changes ##### Barcode * Enabling the [“ocr_fallback" symbology extension](../symbology-properties#symbology-extension-descriptions) with missing OCR model resources now triggers the context error 28 (“Missing Resource”) ##### Smart Label Capture * Validation Flow: Manually input values for barcodes will go through a stricter validation. Some values may no longer be accepted if they do not match the symbology specs for the symbology’s definition #### Bug Fixes ##### Barcode * Fixed a rare out-of-bound memory access crash when scanning low-resolution or blurry `EAN13/UPCA` codes at a specific distance * Fixed an issue that caused continuous scanning to stop working when rotating the device * Fixed an issue where FrameData was not usable for tracking modes ##### Core * Fixed a small memory leak that affected fresh install runs only * Overcome orientation change limitation in iOS PWAs when display mode is fullscreen or standalone ### 8.0.1 **Released**: January 14, 2026 #### Bug Fixes ##### Barcode * Fixed a rare out-of-bound memory access crash when scanning low-resolution or blurry `EAN13/UPCA` codes at a specific distance ##### Core * Fixed a small memory leak that affected fresh install runs only ### 8.0.0 **Released**: November 4, 2025 #### New Features Scandit's SDK 8.0 marks the evolution of data capture from a high-performing scanning tool into an intelligent AI-powered workflow enabler. As frontline operations face mounting pressures with more data points to capture, increasingly complex workflows to navigate, and tighter resource constraints, SDK 8.0 delivers a set of innovations that: * Adapt its scanning settings and UI to context by analyzing the scanning environment and user intent; * Automate the capture of any data format, barcode clustering, task handling or camera settings; * Accelerate critical use cases to maximize ROI through intuitive, streamlined scanning workflows, using interactive AR-guidance, adaptive UI and out-of-the-box custom-branded passenger experiences. With SDK 8.0 businesses can transform data capture from a basic function to a strategic advantage. It enables intelligent scanning that: * Understands not just what is being scanned, but also what you want to scan and why you’re scanning it * Adapts accordingly by adjusting scanning settings and/or UI, understanding what comes next and how to guide users through sophisticated tasks to ensure the highest level of productivity. ##### Core * The [`Camera`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera.html#class-scandit.datacapture.core.Camera) API has been completely redesigned for this release. See the [API reference](https://docs.scandit.com/data-capture-sdk/web/core/api/camera.html#camera) for complete details. * The minimum Chrome version supported is now 85+. * The `DataCaptureContext.create`, `createWithOptions` and `configure` methods have been removed in favor of [`DataCaptureContext.forLicenseKey`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#method-scandit.datacapture.core.DataCaptureContext.ForLicenseKey). ##### Barcode * Smart Scan Selection is now available in SparkScan for the Web SDK. * Adapted [`SparkScanView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView) to now be usable as a web component. Also added a `SparkScanReactSample` to demonstrate this usage. * The following have been added to MatrixScan AR: * [`BarcodeArView.getHighlightForBarcode`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-view.html#method-scandit.datacapture.barcode.ar.ui.BarcodeArView.GetHighlightForBarcode) * [`BarcodeArView.getAnnotationForBarcode`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/barcode-ar-view.html#method-scandit.datacapture.barcode.ar.ui.BarcodeArView.GetAnnotationForBarcode) ##### Smart Label Capture * We’re introducing an enhancement that makes Smart Label Capture more robust and scalable by complementing its on-device model with a larger, more capable model. When the on-device model can’t capture certain labels, the SDK automatically escalates to this enhancement to handle complex or unforeseen cases with high accuracy and reliability. This capability is currently available in `beta`. If you’re interested in trying it, please contact Scandit Support. For configuration details, see `labelDefinition.adaptiveRecognitionEngine`. ##### ID * Added `ElementsToRetain` to [`MobileDocumentScanner`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mobile-document-scanner.html#class-scandit.datacapture.id.MobileDocumentScanner): The set of data elements that the application intends to retain from scanned mobile documents. This information is used to set the `IntentToRetain` flag in ISO 18013-5 mdoc requests, which is required for legal compliance with data protection standards. An empty set indicates no elements will be retained, and `IntentToRetain` will be set to `false` for all fields. * ID Capture now supports full-frame anonymization. * The result of `decodeMobileDriverLicenseViz`, which is currently returned as part of the [`VIZResult`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/viz-result.html#class-scandit.datacapture.id.VizResult) within [`CapturedId`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/captured-id.html#class-scandit.datacapture.id.CapturedId), will now be provided through a new field named [`mobileDocumentOCRResult`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/captured-id.html#property-scandit.datacapture.id.CapturedId.MobileDocumentOcr). * Added [`CapturedId.isCitizenPassport`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/captured-id.html#property-scandit.datacapture.id.CapturedId.IsCitizenPassport), which indicates whether the passport was issued to a citizen of the issuing country. Returns `false` for travel documents such as refugee, stateless, or alien passports, and for any passports issued by organizations rather than states. * The following Chinese travel permits now extract VIZ + MIZ data during double-sided scanning flows: * CT - Taiwan Residents Mainland Travel Permit * W - Mainland Residents Exit-Entry Permit to and from Hong Kong and Macao * CD - Mainland Residents Entry-Exit Permit to and from Taiwan #### Behavioral Changes ##### Barcode * Symbology `RM4SCC` has been renamed to `ROYAL_MAIL_4STATE`. * Changed the default highlight brush in SparkScan and Barcode Capture. ##### Label * The `LabelFieldDefinition` API has been updated with the following changes: * Renamed property: `pattern` → `valueRegex`, `patterns` → `valueRegexes` * Renamed property: `dataTypePattern` → `anchorRegex`, `dataTypePatterns` → `anchorRegexes` * Receipt Scanning API has been updated with the following changes: * `ReceiptScanningResult`: * Removed properties: `storeNumber`, `storeStreet`, `storeZip`, `storeState`, `storePhone`, `paymentMethod`, and `paymentCurrency`. * Added property: `storeAddress` - Full address of the store (Street Number, Street, City, State, NPA). * Renamed property: `paymentSubtotal` → `paymentPreTaxTotal` - Total balance before taxes are applied. * `ReceiptScanningLineItem`: * Removed property: `category`. * Renamed properties: `price` → `unitPrice` (Price for a single unit of the item), `total` → `totalPrice` (Total price for a specific product, quantity × unitPrice). ##### ID * The configuration for the following documents has been changed as detailed below: * Australian mobile driver licenses (mDL) are now treated as normal documents, with no separate mode. * US Green Cards are now treated as residence permits. * Removed the deprecated API `DateResult::toDate`. Use `DateResult::toLocalDate` or `DateResult::toUtcDate` instead. * [`fullName`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.FullName) now an optional field on all [`IdCapture`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/id-capture.html#class-scandit.datacapture.id.IdCapture) result types and [`capturedMrz`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#property-scandit.datacapture.id.MrzResult.CapturedMrz) now an optional field on [`MRZResult`](https://docs.scandit.com/data-capture-sdk/web/id-capture/api/mrz-result.html#class-scandit.datacapture.id.MrzResult). #### Bug Fixes ##### ID * Fixed a bug that could get the scanner stuck when scanning a US passport card. * Fixed an issue where unavailable dates would not be properly set to `null` in an ID scan result. #### Deprecations ##### Core * [`VideoResolution.Auto`](https://docs.scandit.com/data-capture-sdk/web/core/api/camera-settings.html#value-scandit.datacapture.core.VideoResolution.Auto) is now deprecated. Please use the capture mode's `recommendedCameraSettings` for the best results. ##### Barcode * All previously deprecated APIs have been removed in this release. * `DataCaptureContext.create`, `createWithOptions` and `configure` have been removed in favor of the [`forLicenseKey`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#method-scandit.datacapture.core.DataCaptureContext.ForLicenseKey) method. ### 7.6.7 Find earlier versions in the [release notes section of version 7](/7.6.15/sdks/web/release-notes) --- ## Composite Codes The Scandit Data Capture SDK supports scanning of all [GS1 Composite Codes](../barcode-symbologies#gs1-composite-codes). The specification defines three different types: A, B and C. :::note Composite codes are only supported in `SDCBarcodeCapture`. ::: For composite codes Type A and B the 2D component is always a `SDCSymbologyMicroPDF417` and the 1D component can be any of the following symbologies: * `SDCSymbologyEAN13UPCA` * `SDCSymbologyEAN8` * `SDCSymbologyUPCE` * `SDCSymbologyGS1Databar` * `SDCSymbologyGS1DatabarExpanded` * `SDCSymbologyGS1DatabarLimited` For composite codes of Type C the 2D component is always `SDCSymbologyPDF417` while the 1D component is `SDCSymbologyCode128`. ### Enabling Composite Codes Composite code scanning is enabled in the `SDCBarcodeCaptureSettings` as follows: * One or more composite types need to be enabled via `enabledCompositeTypes` * The symbologies associated with those composite types need to be enabled through `enableSymbologiesForCompositeTypes:`. For example, to enable scanning of composite code A: * First `SDCCompositeTypeA` is enabled with a call to `enabledCompositeTypes` * A call to `enableSymbologiesForCompositeTypes:` passing `SDCCompositeTypeA` the following symbologies will be enabled: * `SDCSymbologyEAN13UPCA` * `SDCSymbologyEAN8` * `SDCSymbologyUPCE` * `SDCSymbologyGS1Databar` * `SDCSymbologyGS1DatabarExpanded` * `SDCSymbologyGS1DatabarLimited` * `SDCSymbologyMicroPDF417` The same can be accomplished by individually enabling all of these symbologies with `setSymbology:enabled:`. `enableSymbologiesForCompositeTypes:` is a convenience function to enable all at once for a certain composite type. If you only want to scan a subset of the possible symbologies of a composite type then you should only enable those. It is not possible to disable a specific symbology, like `SDCSymbologyGS1DatabarExpanded` for `SDCCompositeTypeA` but keep it enabled for `SDCCompositeTypeB`, it is either enabled for both or neither. The following lines of code show you how this is done to enable scanning of composite codes A and C. Composite code B will not be recognized in these examples as `SDCCompositeTypeB` is not enabled: ```swift let settings = BarcodeCaptureSettings() let compositeTypes: CompositeType = [.a, .c] settings.enableSymbologies(forCompositeTypes: compositeTypes) settings.enabledCompositeTypes = compositeTypes ``` :::note Enabling composite codes will slow down the recognition of non-composite codes slightly. You should only enable composite codes if you expect them to be present. ::: ### Improving Composite Code Recognition The `SDCSymbologyMicroPDF417` is contained in all composite codes A and B but is generally not very easy to recognize in a large scan area because of its compressed size. To improve the recognition rate it is advised to restrict the scan area when scanning Composite Code A and B, which is best done through a rectangular location selection. ### Reading Composite Code Data When composite codes are enabled the Scandit Data Capture SDK automatically couples the composites to the main code and returns the composite’s data through `SDCBarcode.compositeData` and `SDCBarcode.compositeRawData`. There are two potential cases when a barcode of a symbology with enabled composite extension is returned: * The barcode has a composite and is returned with composite data * The barcode does not have an composite and is returned without composite data Inside `SDCBarcodeCaptureListener.barcodeCapture:didScanInSession:frameData:` the data can be retrieved from the recognized barcode as follows: ```swift guard let barcode = session.newlyRecognizedBarcode, let data = barcode.data else { return } if let compositeData = barcode.compositeData { // Do something with the data & compositeData. } else { // Do something with just the data. } ``` --- ## Single Barcode Scanning Implementing single scanning of barcodes using the Scandit Data Capture SDK can be done in two ways: - **(Recommended)** Implementing SparkScan, our pre-built UI and workflow for barcode scanning. - Implementing the low-level Barcode Capture API. The SparkScan API provides pre-built UI elements (trigger button, camera view, camera controls), a complete scanning workflow (visual, audio, and haptic feedback, and UI transitions on scan) and offers additional functionality needed to achieve optimal scanning UX, such as: - Triggering scans via a hardware trigger (volume or dedicated hardware button) - Pre-built code rejection and error handling options - Option to choose between single and continuous scanning, programmatically or with hold gesture - Battery-optimizing features such as idle timeout and camera standby - A floating UI that keeps your focus on the tasks at hand while offering the best scanning performances ![SparkScan Workflow](/img/sparkscan/workflow-example.gif) Scanning to a list with SparkScan All of the above functionality is available out-of-the-box, without having to create it yourself via the low-level API. Both SparkScan and Barcode Capture include AI-powered scanning capabilities that automatically handle challenging scenarios such as avoiding unintentional scans, selecting barcodes in dense environments, scanning damaged barcodes with OCR fallback, and intelligently filtering duplicate scans. See the [AI-Powered Barcode Scanning](../ai-powered-barcode-scanning) guide for details. --- ## Advanced Configurations (52) SparkScan is optimized by default for efficiency, accuracy, and responsiveness. However, there are some cases where you might want to customize the behavior of SparkScan. This guide will show you how to add additional capabilities and further customize SparkScan to best fit your needs. ### Advanced Capabilities #### Trigger Error State You may want to introduce logic in your app to show an error message when scanning specific barcodes (for example, barcodes already added to the list, barcodes from the wrong lot etc.). SparkScan offers a built-in error state you can easily set to trigger an error feedback prompt to the user. You will be able to customize: - The text message - The timeout of the error message: the scanner will be paused for the specified amount of time, but the user can quickly restart the scanning process by tapping the trigger button :::tip A high timeout (>10s) typically requires the users to interact with the UI to start scanning again. This is a good choice when you want to interrupt the scanning workflow (for example, because a wrong barcode is scanned and some actions need to be performed). A small timeout (\<2s) could allow the user to scan again without having to interact with the app, just momentarily pausing the workflow to acknowledge that a “special” barcode has been scanned. ::: - The color of the flashing screen upon scan. You can enable or disable the visual feedback via [SparkScanViewSettings.visualFeedbackEnabled](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#property-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings.VisualFeedbackEnabled) and you can control the color via [SparkScanBarcodeFeedback](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-barcode-feedback.html#sparkscan-barcode-feedback). An error example is here reported: To emit an error, you have to implement a [`SparkScanFeedbackDelegate`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-feedback-delegate.html#interface-scandit.datacapture.barcode.spark.feedback.ISparkScanFeedbackDelegate) and set it to the `SparkScanView`: ```js sparkScanView.feedbackDelegate = sparkScanFeedbackDelegate; ``` In the [`SparkScanFeedbackDelegate.getFeedbackForBarcode()`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-feedback-delegate.html#method-scandit.datacapture.barcode.spark.feedback.ISparkScanFeedbackDelegate.GetFeedbackForBarcode) you can then return an error or a success feedback: ```js const sparkScanFeedbackDelegate = { getFeedbackForBarcode: (barcode: Barcode) => { if (isValidBarcode(barcode)) { return new SparkScanBarcodeSuccessFeedback(); } else { return new SparkScanBarcodeErrorFeedback( 'This code should not have been scanned', 60 * 1000, Color.fromHex('#FF0000'), new Brush(Color.fromHex('#FF0000'), Color.fromHex('#FF0000'), 1), ); } }, }; ``` You can have different error states triggered by different logic conditions. These errors can show different colors and have different timeouts. For example: ![Wrong scan error](/img/sparkscan/error-wrong.png) This error state for a code that should not have been scanned. ![Duplicate scan error](/img/sparkscan/error-duplicate.png) This error state for a code that has been scanned more than once. #### Reject Barcodes To prevent scanning unwanted barcodes (like those already listed or from incorrect lots), use SparkScan’s built-in error state. Setting the [`SparkScanBarcodeErrorFeedback.resumeCapturingDelay`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-barcode-feedback.html#property-scandit.datacapture.barcode.spark.feedback.Error.ResumeCapturingDelay) parameter to 0 allows the user to continue scanning immediately without pausing on rejected codes. ### UI Customization :::tip Please refer to [SparkScanView](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView) for the full list of parameters. ::: export default function SparkScanCustomization({ triggerButtonApi = "sparkScanView.isTriggerButtonVisible", showHardwareTrigger = true, labelCaptureButtonApi = "sparkScanView.isLabelCaptureButtonVisible", barcodeFindButtonApi = "sparkScanView.isBarcodeFindButtonVisible", barcodeCountButtonApi = "sparkScanView.isBarcodeCountButtonVisible", showBarcodeCountButton = true, codeLanguage = "sh", uiDelegateApi = "SparkScanView.uiDelegate", }) { const advancedModesText = showBarcodeCountButton ? "MatrixScan Find or MatrixScan Count" : "MatrixScan Find or Label Capture"; const uiDelegateCallbacks = showBarcodeCountButton ? "the MatrixScan Find button or MatrixScan Count button" : "the MatrixScan Find button or Label Capture button"; const toolbarCaption = showBarcodeCountButton ? "The toolbar with MatrixScan Find and MatrixScan Count buttons." : "The toolbar with MatrixScan Find and Label Capture buttons."; const codeComment = showBarcodeCountButton ? "// Show the Label Capture, MatrixScan Count, and MatrixScan Find buttons" : "// Show the Label Capture and MatrixScan Find buttons"; const codeLines = [ codeComment, `${labelCaptureButtonApi} = true`, showBarcodeCountButton ? `${barcodeCountButtonApi} = true` : null, `${barcodeFindButtonApi} = true`, ].filter(Boolean).join('\n'); return <> You can customize many aspects of the default SparkScan UI and UX to suit your needs and particular use case. These customizations include the: Colors of all items (i.e. icons, buttons, toolbar) Trigger button icon All toast messages Size of the preview Visibility of any/all icons Trigger button Trigger button The default SparkScan trigger button is optimized for common industry use cases based on customer feedback and implementation experience. Custom trigger implementations are also supported. This is achieved by hiding the default trigger button (via {triggerButtonApi}), and then controlling the scanning process as best suits your needs: Using a custom button embedded in you app to call sparkScanView.startScanning() to start scanning. You can adapt the trigger button to the state changes using the SparkScanViewUiListener. Using the mini-preview close button (via sparkScanView.previewCloseControlVisible) or your desired button (via sparkScanView.pauseScanning()) to stop scanning. {showHardwareTrigger && Alternatively, you can rely entirely on a hardware button, if you have enabled that feature (via sparkScanViewSettings.hardwareTriggerEnabled). } Some example customizations: ![SparkScan Customized on Mobile](/img/sparkscan/SparkScanSelfScanning.png) Customized Self-Scanning application with custom FAB button and preview expanded by default ![SparkScan Customized on Tablet](/img/sparkscan/SparkScanmPOS.png) Customized mPOS application using the existing scan button to trigger the scanner Settings Toolbar The Settings Toolbar is hidden by default in SparkScan, as the most relevant controls are already visible in the camera preview. However, additional advanced controls can be made available, such as: Target Mode Continuos Mode By enabling the visibility of these buttons, the Settings Toolbar will appear at the bottom of the camera preview. Add Advanced Scanning Modes to the Toolbar SparkScan is our best solution for high-speed single scanning and scan-intensive workflows. Depending on your use case, you can use SparkScan in conjunction with other Scandit advanced scanning modes, such as {advancedModesText}, to speed up your workflows. SparkScan offers pre-build buttons you can add to the setting toolbar to easily move to different scan modes from within the SparkScan UI. First you will need to show these buttons: {codeLines} ![Toolbar without Scanning Modes](/img/sparkscan/toolbar.png) The standard toolbar without additional scanning modes added. ![Toolbar with Scanning Modes](/img/sparkscan/toolbar-buttons.png) {toolbarCaption} In addition you have to add a delegate to the SparkScanView via {uiDelegateApi}. You will then receive callbacks when {uiDelegateCallbacks} is tapped from the toolbar. ; } ### Workflow Options This section explains all the available options to configure SparkScan to best fit your case, in case you found something that didn't work well in the default configuration (that remains our recommended option). Developers can set a combination of selection mode, scanning behavior and camera preview behavior, defining the initial state of the scanner. Set the selection mode with [`SparkScanSettings.selectionMode`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-settings.html#property-scandit.datacapture.barcode.spark.SparkScanSettings.SelectionMode), and the two behaviors with [`SparkScanViewSettings.scanningBehavior`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#property-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings.ScanningBehavior) and [`SparkScanViewSettings.previewBehavior`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#property-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings.PreviewBehavior). This combination allows for flexible configurations to suit different scanning needs. #### Selection Mode The selection mode determines whether an aimer is shown in the preview to help with precision scanning. | Mode | Description | | ----------- | --------------------------------------------------- | | **Auto** | The SDK decides: it shows an aimer only when several barcodes are in view and the user shows no clear intention to scan one of them. | | **Off** | This is the default. No aimer. This mode displays a small camera preview to aid with aiming. The preview size and zoom level can be adjusted as needed. The user can aim easily at the intended barcode. | | **On** | This mode always adds an aimer to the camera preview, and the user confirms the aimed barcode with the trigger button. This is recommended only when selecting among many close barcodes is the common task. | :::tip *Auto* requires [`SparkScanSettings.scanIntention`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-settings.html#property-scandit.datacapture.barcode.spark.SparkScanSettings.ScanIntention) to be set to *Smart*. With *Manual*, it behaves like *Off*. Setting the selection mode to *On* forces the aimer to be shown at all times. ::: #### Scanning Behavior The scanning behavior determines how barcodes are scanned - one at a time or continuously. | Behavior | Description | | ------------------- | ---------------------------------------------------------- | | **Single scan** | Scan one barcode at a time. The user needs to trigger the scanner every time to scan a barcode. This allows for a more controlled scanning and lower battery consumption. | | **Continuous scan** | Scan barcodes consecutively. The user needs to trigger the scanner once and barcodes will be scanned without any further interaction before each scan. This allows for a smoother experience when multiple barcodes need to be scanned consecutively. | :::tip Users can enable continuous scanning by holding down the trigger button. This gesture can be disabled ([`SparkScanViewSettings.holdToScanEnabled`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#property-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings.HoldToScanEnabled)). ::: #### Preview Behavior The preview behavior determines how the camera preview behaves when the scanner is not actively scanning. | Behavior | Description | | -------------- | -------------------------- | | **Default** | Preview fades away when the scanner is off. This lets the user check important information displayed by the app and reduces battery consumption. | | **Persistent** | Preview remains visible, but darkened, even when the scanner is off. This is useful for scenarios where you want to select a barcode (among many) or need to look through the preview at all times (to ensure the right scan) - especially if used in conjunction with the selection mode *On*. | --- ## Get Started (97) In this guide you will learn step-by-step how to add SparkScan to your application. The general steps are: 1. Create a new Data Capture Context instance. 2. Configure the Spark Scan Mode. 3. Create the SparkScanView with the desired settings and bind it to the application’s lifecycle. 4. Register the listener to be informed when new barcodes are scanned and update your data whenever this event occurs. ### Prerequisites - The latest stable version of [Node.js and npm](https://nodejs.org/en/download/) (required only if including and building the SDK as part of an app, instead of just including it as an external resource from a CDN in HTML). - A valid Scandit Data Capture SDK license key. You can sign up for a free [test account](https://ssl.scandit.com/dashboard/sign-up?p=test&utm%5Fsource=documentation). - If you have not already done so, see [this guide](../add-sdk.md) for information on how to add the Scandit Data Capture SDK to your project :::note Devices running the Scandit Data Capture SDK need to have a GPU or the performance will drastically decrease. ::: ### Create a New Data Capture Context Instance The first step to add capture capabilities to your application is to create a new [Data Capture Context](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext). The context expects a valid Scandit Data Capture SDK license key during construction. ```js import { DataCaptureContext } from "@scandit/web-datacapture-core"; import { barcodeCaptureLoader, SparkScanSettings, SparkScan, SparkScanViewSettings, } from "@scandit/web-datacapture-barcode"; const dataCaptureContext = await DataCaptureContext.forLicenseKey( "-- ENTER YOUR SCANDIT LICENSE KEY HERE --", { libraryLocation: new URL( "sdc-lib-self-hosted-path", document.baseURI ).toString(), // or use the cdn https://cdn.jsdelivr.net/npm/@scandit/web-datacapture-barcode@latest/sdc-lib/ moduleLoaders: [barcodeCaptureLoader()], } ); ``` ### Configure the SparkScan Mode The SparkScan Mode is configured through [`SparkScanSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-settings.html#class-scandit.datacapture.barcode.spark.SparkScanSettings) and allows you to register one or more listeners that are informed whenever a new barcode is scanned. For this tutorial, we will set up SparkScan for scanning EAN13 codes. Change this to the correct symbologies for your use case (for example, Code 128, Code 39…). ```js const sparkScanSettings = new SparkScanSettings(); sparkScanSettings.enableSymbologies([Symbology.EAN13UPCA]); ``` Next, create a SparkScan instance with the settings initialized in the previous step: ```js const sparkScan = SparkScan.forSettings(sparkScanSettings); ``` ### Setup the Spark Scan View The SparkScan built-in user interface includes the camera preview and scanning UI elements. These guide the user through the scanning process. The [`SparkScanView`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView) appearance can be customized through [`SparkScanViewSettings`](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view-settings.html#class-scandit.datacapture.barcode.spark.ui.SparkScanViewSettings). ```js const sparkScanViewSettings = new SparkScanViewSettings(); // setup the desired appearance settings by updating the fields in the object above ``` See the [SparkScan Workflow Options](./advanced.md#workflow-options) section for more information. By adding a `SparkScanView`, the scanning interface (camera preview and scanning UI elements) will be added automatically to your application. Add a `SparkScanView` to your view hierarchy. Construct a new SparkScan view. The `SparkScanView` is automatically added to the provided `parentView`: ```js const sparkScanView = SparkScanView.forElement( document.body, dataCaptureContext, sparkScan, sparkScanViewSettings ); // setup any desired view properties by updating the fields in the object above ``` Optionally you may set a feedback delegate on the SparkScanView, if you wish to validate barcodes and emit a success or error feedback based on certain conditions: ```js sparkScanView.feedbackDelegate = { getFeedbackForBarcode: (barcode) => { // Replace the line below with your own validation logic if (isInvalidBarcode(barcode)) { // Return an error feedback for invalid barcodes return new SparkScanBarcodeErrorFeedback( "Invalid barcode.", 60_000 // How many ms to wait for scanning to be resumed ); } // Return a success feedback for valid barcodes return new SparkScanBarcodeSuccessFeedback(); }, }; ``` Once your app is ready to mount the SparkScanView, make sure to call [SparkScanView.prepareScanning()](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#method-scandit.datacapture.barcode.spark.ui.SparkScanView.PrepareScanning): ```js async connectedCallback() { await sparkScanView.prepareScanning(); } ``` Additionally, make sure to call [SparkScanView.stopScanning()](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#method-scandit.datacapture.barcode.spark.ui.SparkScanView.StopScanning) when your app is unmounting. You have to call this for disposing the [SparkScanView](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/ui/spark-scan-view.html#class-scandit.datacapture.barcode.spark.ui.SparkScanView). ```js async disconnectedCallback() { await sparkScanView.stopScanning(); } ``` ### Register the Listener To keep track of the barcodes that have been scanned, implement the [SparkScanListener](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-listener.html#interface-scandit.datacapture.barcode.spark.ISparkScanListener) interface and register the listener to the SparkScan mode. ```js // Register a listener object to monitor the spark scan session. const listener = { didScan: (sparkScan, session, frameData) => { // Gather the recognized barcode const barcode = session.newlyRecognizedBarcode; if (barcode != null) { // Handle the barcode } }, }; sparkScan.addListener(listener); ``` [SparkScanListener.didScan()](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-listener.html#method-scandit.datacapture.barcode.spark.ISparkScanListener.OnBarcodeScanned) is called when a new barcode has been scanned. This result can be retrieved by using the [SparkScanSession.newlyRecognizedBarcode](https://docs.scandit.com/data-capture-sdk/web/barcode-capture/api/spark-scan-session.html#property-scandit.datacapture.barcode.spark.SparkScanSession.NewlyRecognizedBarcode) property on the session object. ### Complete SparkScan example ```js import { SparkScan, SparkScanBarcodeErrorFeedback, SparkScanBarcodeSuccessFeedback, SparkScanSettings, SparkScanView, SparkScanViewSettings, Symbology, barcodeCaptureLoader, } from "@scandit/web-datacapture-barcode"; import { DataCaptureContext } from "@scandit/web-datacapture-core"; const context = await DataCaptureContext.forLicenseKey( "-- ENTER YOUR SCANDIT LICENSE KEY HERE --", { libraryLocation: "/self-hosted-sdc-lib/", moduleLoaders: [barcodeCaptureLoader()], } ); const settings = new SparkScanSettings(); settings.enableSymbologies([ Symbology.EAN13UPCA, Symbology.Code128, Symbology.QR, ]); const sparkScan = SparkScan.forSettings(settings); sparkScan.addListener({ didScan: (sparkScan, session) => { const barcode = session.newlyRecognizedBarcode; if (barcode) { console.log("Scanned", barcode.symbology, barcode.data); } }, }); const viewSettings = new SparkScanViewSettings(); const view = SparkScanView.forElement( document.body, context, sparkScan, viewSettings ); view.feedbackDelegate = { getFeedbackForBarcode: (barcode) => { if (barcode.data === "5901234123457") { return new SparkScanBarcodeErrorFeedback("Invalid barcode.", 60_000); } else { return new SparkScanBarcodeSuccessFeedback(); } }, }; async function mount() { await view.prepareScanning(); } async function unmount() { await view.stopScanning(); } mount().catch(async (error) => { console.error(error); await unmount(); }); ``` A more complete example can be found [here on StackBlitz](https://stackblitz.com/github/Scandit/datacapture-web-samples/tree/master/01_Single_Scanning_Samples/01_Barcode_Scanning_with_Pre-built_UI/ListBuildingSample). ### Scan Some Barcodes Now that you’re up and running, go find some barcodes to scan. Don’t feel like getting up from your desk? Here’s a [handy pdf of barcodes](https://github.com/Scandit/.github/blob/main/images/PrintTheseBarcodes.pdf) you can print out. --- ## About SparkScan (10) SparkScan is our pre-built smartphone scanning interface designed for high-performance barcode scanning. It fits on top of any smartphone application, providing an intuitive user interface for simple, fast and ergonomic scanning in scan-intensive workflows, such as inventory management in retail, or goods receiving in logistics. SparkScan bundles multiple scanning features together and addresses many common challenges associated with scanning on smart devices. It is designed to be easily integrated into any application, and can be customized to fit your specific needs. ### UI Overview The UI elements in SparkScan are intentionally minimalistic, meant to be overlayed on any application without the need to adapt the existing app while offering the best user experience. Two main elements compose the UI: ![SparkScan UI](/img/sparkscan/features_web.png) - **Camera preview**: A small camera preview that helps with aiming and shows scan feedback. When not in use, the camera preview is hidden. It can be expanded and hosts easy to access controls (zoom level, flash etc). - **Trigger button**: A large-sized, semi-transparent floating button that users can drag to position it in the most ergonomic position. When not in use, the trigger button collapses to occupy less space. There are additional UI elements available for displaying additional scanning modes, errors, or providing feedback to the user. These are described in the Advanced section. ### Workflow Description When SparkScan is started, the UI presents just the trigger button, collapsed. The user can move the trigger button by simply dragging it around: the position of the trigger button is remembered across sessions, so the user can place the button where it's the most comfortable to use. To start scanning, the user can simply tap on it. When the scanner is active, the mini preview is shown. The mini preview too can be placed anywhere in the view by simply pressing on it for a little while and then dragging it around. Also the position of the mini preview is remembered across sessions, so the user can place it where it prefers (e.g. not to cover an important information at the top of the app). In the default configuration: - Upon scan the user will receive audio/haptic feedback confirming the scan, and the mini preview will display the scanned barcode for a small amount of time before fading away. - Tapping on the trigger button or the mini preview will restart immediately the scanner. Upon completing the scanning process (or to interact with the customer app layer), the user can tap in any area outside the trigger button and the mini preview. This collapses the scanner button, going back to the initial state. If instead of tapping on the trigger button the user taps and holds it pressed, he will be able to scan multiple barcodes in a row. The scanner will stop when the trigger button is released. ![SparkScan Workflow](/img/sparkscan/workflow-example.gif) List building use case using SparkScan. The default workflow just described has been carefully designed as a result of extensive user testing and customer feedback from the field. But not all use-cases look the same, and your needs may differ for most users. That's why SparkScan comes with a set of options to configure the scanner and to best fit in the desired workflow. Check the Workflow Options guide to discover more. ### Supported Symbologies SparkScan supports all of the major symbologies listed here: Barcode Symbologies. ### AI-Powered Features SparkScan includes AI-powered scanning capabilities that enhance accuracy and user experience. These features automatically handle challenging scenarios such as avoiding unintentional scans, selecting barcodes in dense environments, scanning damaged barcodes with OCR fallback, and intelligently filtering duplicate scans. Learn more about these capabilities in our AI-Powered Barcode Scanning guide. --- ## Symbology Properties Symbologies often have different properties, such as symbol count (length of the barcode) or inverted colors (printed white on black). To provide optimal performances, some properties/values are disabled by default in our SDK. You might need to scan a symbology whose properties are by default disabled. This article lists all symbology specific properties, their defaults and possible values. ### 1D Symbology Properties * Color-inverted (bright bars on dark background) decoding for symbologies that support it is disabled and must be explicitly enabled. * Optional checksum digits (for example, in interleaved 2 of 5 or MSI-Plessey codes) are always returned as part of the data. * The symbol count is the number of barcode symbols, not the number of characters in the result. For example, a Code 32 code has eight symbols (six base-32 data symbols plus the start and end symbols) and returns nine digits (eight data digits and a mod10 check digit). | Symbology |         Checksum          | Symbol Count | Supports Color-Inversion | Extensions | |-----------|:-----------|--------------|:------------------------:|---------------| | EAN-13 UPC-A | **Mandatory**: mod10 | **Default**: 12 **Range**: 12 | yes| relaxed_sharp_quiet_zone_check remove_leading_upca_zero two_digit_add_on five_digit_add_on strict ocr_fallback | | EAN-8 | **Mandatory**: mod10 | **Default**: 8 **Range**: 8 | yes| relaxed_sharp_quiet_zone_check two_digit_add_on five_digit_add_on strict | | UPC-E | **Mandatory**: mod10 | **Default**: 6 **Range**: 6 | yes| return_as_upca remove_leading_upca_zero two_digit_add_on five_digit_add_on strict | | Two-Digit Add-on | **Mandatory**: mod10 | **Default**: 2 **Range**: 2 | yes| strict | | Five-Digit Add-on | **Mandatory**: mod10 | **Default**: 5 **Range**: 5 | yes| strict | | MSI Plessey | **Mandatory**: none **Supported**: mod10, mod11, mod1010, mod1110 **Default**: mod10 | **Default**: 6-32 **Range**: 3-32 | no| strict | | Code 128 | **Mandatory**: mod103 | **Default**: 6-40 **Range**: 4-50 | yes| strip_leading_fnc1 strict ocr_fallback | | Code 11 | **Mandatory**: none **Supported**: mod11 **Default**: mod11 | **Default**: 7-20 **Range**: 5-34 | no| strict | | Code 25 | **Mandatory**: none **Supported**: mod10 | **Default**: 7-20 **Range**: 3-32 | no| strict | | IATA 2 of 5 | **Mandatory**: none **Supported**: mod1010 | **Default**: 7-20 **Range**: 3-32 | no| strict | | Matrix 2 of 5 | **Mandatory**: none **Supported**: mod10 | **Default**: 7-20 **Range**: 3-32 | no| strict | | Code 32 | **Mandatory**: mod10 | **Default**: 8 **Range**: 8 | no| strict | | Code 39 | **Mandatory**: none **Supported**: mod43 | **Default**: 6-40 **Range**: 3-50 | yes| full_ascii relaxed_sharp_quiet_zone_check strict ocr_fallback | | Code 93 | **Mandatory**: mod47 | **Default**: 6-40 **Range**: 5-60 | yes| full_ascii strict | | Codabar | **Mandatory**: none **Supported**: mod16, mod11 | **Default**: 7-20 **Range**: 3-34 | no| strict remove_delimiter_data ocr_fallback | | GS1 DataBar 14 | **Mandatory**: mod10 | **Default**: 2 **Range**: 2 | no| strict | | GS1 DataBar Expanded | **Mandatory**: mod211 | Not configurable | no| strict | | GS1 DataBar Limited | **Mandatory**: mod89 | **Default**: 1 **Range**: 1 | no| relaxed_sharp_quiet_zone_check strict | | ITF | **Mandatory**: none **Supported**: mod10 | **Default**: 6-40 **Range**: 4-50 | no| strict | | ROYAL_MAIL_4STATE | **Mandatory**: mod103 | **Default**: 7-24 **Range**: 4-50 | no| | | KIX | **Mandatory**: none | **Default**: 7-24 **Range**: 4-50 | no| | | LAPA | **Mandatory**: none | **Default**: 16 **Range**: 16 | no| | | USPS Intelligent Mail | **Mandatory**: none | **Default**: 65 **Range**: 65 | no| | | UPU S18 4-State | **Mandatory**: none | **Default**: 19 or 25 **Range**: 19 or 25 | no| fluorescent_orange_ink | | Australian Post 4-State | **Mandatory**: none | **Default**: 10-41 **Range**: 10-41 | no| force_table_c force_table_n decode_bar_states | | French Post | **Mandatory**: none | | no| fluorescent_orange_ink | ### 2D Symbology Properties * Color-inversion (bright modules on a dark background) decoding is **enabled by default only for QR Code and Micro QR Code**. For all other 2D symbologies that support it, it is disabled by default and must be explicitly enabled. | Symbology | Supports Color-Inversion | Extensions | |----------------|--------------------------|------------------------| | Aztec Code | yes | | | Data Matrix | yes | strip_leading_fnc1 (enabled by default) direct_part_marking_mode | | DotCode | yes | | | MaxiCode | no | | | MicroPDF417 | no | | | PDF417 | no | | | QR Code | yes | | | Micro QR Code | yes | | | ArUco | yes | | ### Symbology Extension Descriptions | Extension | Description | |----------------------------------------|---------------------------------------------------------------| | full_ascii | Interprets the Code39 code data using two symbols per output character to encode all ASCII characters. | | relaxed_sharp_quiet_zone_check | Enables scanning codes that have quiet zones (white area before and after the code) that are significantly smaller than allowed by the symbology specification. Use this extension if you are having difficulties to scan codes due to quiet zone violations. However, enabling it may come at the cost of more false positives under certain circumstances. | | return_as_upca | Transforms the UPCE result into its UPCA representation. | | remove_leading_upca_zero | Removes the leading zero digit from the result if the UPCA representation extension ‘return_as_upca’ is enabled. | | strip_leading_fnc1 | Removes the leading FNC1 character that indicates a GS1 code. To determine whether a certain code is a GS1 code, use ref sc_barcode_is_gs1_data_carrier. | | direct_part_marking_mode | Use this mode to improve scan performance when reading direct part marked (DPM) Data Matrix codes. Enabling this extension comes at the cost of increased frame processing times. It is recommended to restrict the scanning area to a smaller part of the image for best performance. | | strict | Enforce strict standard adherence to eliminate false positives in blurry, irregular or damaged barcodes at the cost of reduced scan performance. | | fluorescent_orange_ink | Enables the scanning of low contrast fluorescent orange codes. Enabling this option can have a negative impact on the scan performance of other symbologies. | | force_table_c, force_table_n and decode_bar_states | For Australian Post 4-State, customer information is decoded by default with Table N, and Table C is used as a fallback. force_table_c and force_table_n respectively enforce decoding with either C or N tables, and the symbology extension decode_bar_states will return the error-corrected customer information bars as a string of the bar states, A for ascending, D for descending, T for tracker and F for full. | | remove_delimiter_data | For Codabar, removes the start and stop characters from the code and returns only the body of the code in the result. | | ocr_fallback | Enables Optical Character Recognition of text as a fallback when other readers fail. This feature requires Smart Scan Intention which is available in SparkScan, Barcode Capture, or through the Linux settings preset `SC_PRESET_SINGLE_CODE_HAND_HELD`. Optionally set a RegEx pattern to constrain results using `SymbologySettings.ocrFallbackRegex()`. **Requires the `LabelCaptureText` module.** | ### Calculating Symbol Counts for Variable-Length Symbologies The length of data encoded in variable-length symbologies such as Code 128, Codabar, Code 39 etc. is measured as the number of symbols. Depending on the symbology, the symbol count includes the start and end symbol, and/or checksum characters. The following list shows how to calculate the number of symbols for each variable-length symbology. These counts can be used as the input to `sc_symbology_settings_set_active_symbol_counts()`. #### Interleaved-Two-of-Five The number of symbols corresponds to the number of digits in the code. Note that the number of digits must be even. Example: the code `“1234567890123”` has a symbol count of 14. For the active symbol count calculation, optional checksum digits are treated like normal data symbols. #### Codabar The number of symbols corresponds to the number of digits in the code, plus the start and end symbols. Example: the code `“A2334253D”` has a symbol count of 7 + 2 = 9. #### Code 11 The number of symbols corresponds to the number of digits in the code, plus one or two checksum symbols. For less than ten digits in the code, one checksum symbol is added. Two checksum symbols are added for ten or more digits in the code. Example: the code `“912-34956”` (`“912-349566”`) has a symbol count of 9 + 1 = 10. The code `“912-3495-6”` (`“912-3495-638”`) has a symbol count of 10 + 2 = 12. #### Code 128 The number of symbols depends on the encoding used (A, B or C). All encodings require a start, an end and a checksum symbol. The ASCII encoding modes (A and B) store each character in one symbol. Example: the code `“ABC123”` in mode A has a symbol count of 6 + 2 + 1 = 9. The numeric encoding mode (C) encodes pairs of digits in one symbol. Example: the code `“123456”` has a symbol count of 3 + 2 + 1 = 6. Some encoders switch modes inside the code using switch symbols to optimize the code length. In this case the exact encoding used is needed to compute the number of symbols. #### Code 93 The number of symbols corresponds to the number of characters in the code, plus the start and end symbols and 2 checksum digits. Shift characters used in “extended code93” are treated as normal data symbols. Example: the code `“ABCDE12345”` has a symbol count of 10 + 2 + 2 = 14. #### Code 39 The number of symbols corresponds to the number of characters in the code, plus the start and end symbols. Note that the start and end symbols are not included in the returned barcode data. Example: the code `“4F70050378196356D”` (`“*4F70050378196356D”`) has a symbol count of 17 + 2 = 19. #### MSI Plessey and Code 25 The number of symbols corresponds to the number of digits in the code. Example: the code `“12345674”` has a symbol count of 8. For the active symbol count calculation, optional checksum digits are treated like normal data symbols. #### GS1 DataBar 14 The symbol count corresponds to the number of finder patterns in the code. Each finder is accompanied by two data segments. #### GS1 DataBar Expanded The symbol count cannot be changed. All lengths defined by the standard are supported. #### ROYAL_MAIL_4STATE The number of symbols corresponds to the number of characters in the code, including the checksum character. #### KIX The number of symbols corresponds to the number of characters in the code. #### UPU 4-State The number of symbols corresponds to the number of code words. Two lengths are supported, 19 or 25 codewords with a maximum number of error correcting codewords of 6 or 12 respectively. #### Australian Post 4-State The number of symbol corresponds to 10 digit FCC and DPID codes, and up to 31 characters representing the customer information bar states. --- ## System Requirements ### Native SDK #### iOS | Requirement | Version | | ----------- | ------- | | iOS | 15.0+ | | Xcode | 16.3+ | | Architecture| arm64, x86_64 | | Camera | 720p+ | | GPU | | #### Android | Requirement | Version | | ----------- | ------- | | Android | 7.0+ (API level 24) | | Java | 8+ | | Architecture| arm64v7, arm64, x86, x86_64 | | Camera | 720p+ | | GPU | | :::note On Android hardware acceleration has to be enabled for the camera preview to work. Hardware acceleration is enabled by default since API level 14 but can potentially be turned off in the Manifest, do not do this if you use the camera. ::: #### Linux Supported distributions: * Ubuntu 18.04 or newer * Debian/GNU Linux 10 (Buster) or newer * Raspbian 2017-08-17 or newer :::note Most Debian/GNU Linux based systems should be supported as as long as the dependency requirements below are met. RedHat based systems (RPM packages) are not supported officially. The tool 'alien' can be used to convert the Debian packages to RPM packages. If you want to run the SDK on any other Linux distribution, unpack the `.deb` file and install the library and headers manually. ::: ##### Dependencies | Requirement | Version | | ----------- | ------- | | GCC (or a comparable compiler) | >= 4.9 | | libc | >= 2.27 | | pthread | - | | dbus | >= 1.6.8 | | zlib | >= 1.2.8 (i386 and arm64 only) | | NEON CPU support (armhf only) | - | | OpenGLES (optional for GPU acceleration) | >= 2.0 | | Python (optional for the Python bindings) | >= 3.0 | ### Web SDK | Requirement | Notes | | ----------- | ----- | | Blob | [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) is used to store the video stream. Check [supported browser versions](https://caniuse.com/#feat=blobbuilder). | | WebAssembly | [WebAssembly](https://developer.mozilla.org/en-US/docs/WebAssembly) is used to run the video processing algorithms. Check [supported browser versions](https://caniuse.com/#feat=wasm). | | URL/createObjectURL | [URL.createObjectURL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) is used to create a URL for the video stream. Check [supported browser versions](https://caniuse.com/#feat=bloburls). | | Web Workers | [Web Workers](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) are used to run the video processing algorithms in a separate thread. Check [supported browser versions](https://caniuse.com/#feat=webworkers). | | SharedArrayBuffer | [SharedArrayBuffer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) is **required** for simultaneous multiple barcode tracking. Check [supported browser versions](https://caniuse.com/#feat=sharedarraybuffer). | | MediaDevices.getUserMedia | Optional. [MediaDevices.getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) is required for camera video streaming. Check [supported browser versions](https://caniuse.com/#feat=stream). | | OffscreenCanvas | Optional. [OffscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas) allows for GPU acceleration in Web Worker. Check [supported browser versions](https://caniuse.com/#feat=offscreencanvas). | | WebGL | Optional. [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API) is used for GPU acceleration. Check [supported browser versions](https://caniuse.com/#feat=webgl). | | WebAssembly SIMD | Optional. [WebAssembly SIMD](https://chromestatus.com/feature/6533147810332672) is used for OCR computation acceleration. | #### Browser Compatibility | Browser | Threads | Single thread | |------------------------|---------|---------------| | Chrome | 85+ | 85+ | | Edge | 85+ | 85+ | | Firefox | 105+ | 105+ | | Opera | 71+ | 71+ | | Safari | 15.2+ | 14.6+ | | Chrome Android | 85+ | 85+ | | Firefox Android | 105+ | 105+ | | Opera Android | 80+ | 60+ | | Safari iOS / Chrome iOS (webkit) | 16.4+ | 14.6+ | | Samsung Internet | 15+ | 7+ | | Webview Android | No | Yes | :::warning Web SDK 8.7 is the last version that supports Safari versions earlier than 16.4, on both macOS and iOS. Starting with version 8.8, the Web SDK requires Safari 16.4 or later. On iOS this applies to every browser, because they all use WebKit. ::: ### Frameworks These platforms are based on the native platforms and therefore the requirements of native platforms apply as well. If a framework has stricter requirements (for example, it only supports newer versions of Android/iOS) it is explicitly stated. | Platform | Requirements | |-----------------|-----------------------------------------------------| | Capacitor | - Capacitor 5.0.0 - Swift 4.0+ | | Cordova | - cordova 12.0.0 - cordova-android 10.0.0 - cordova-ios 6.3.0 - Swift 5.0+ | | Flutter | - Flutter 3.22.0+ (Dart 3.4.0+) - Swift 5.0+ | | Kotlin Multiplatform | - Kotlin 2.3.21+ - Gradle 8.14+ - Android Gradle Plugin 8.10.1+ - Android compile and target SDK 36, JVM target 17 - Xcode 16.3+ (Swift 6.1+) - See [System Requirements for Kotlin Multiplatform](/sdks/kmp/system-requirements.mdx) | | React Native | - react-native 0.70+ (0.72+ recommended for modern toolchain support) - react-native 0.78+ required when the New Architecture is enabled - Kotlin 1.9.25 - Swift 5.0+ | | Titanium | - Titanium 13.0.0+ | | .NET for iOS | - .NET SDK 6.0.403+ | | .NET for Android| - .NET SDK 6.0.403+ - Kotlin 1.9.25 | :::warning **React Native Known Issues:** While Our SDK integrates perfectly with React Native 0.70.x, this version has known build toolchain compatibility issues with modern development environments (unrelated to the Scandit SDK). These are React Native framework limitations and not caused by the Scandit SDK. We recommend using React Native 0.72+ to avoid these issues.: * Android Gradle Plugin version conflicts * Kotlin version incompatibilities * AndroidX dependency version matrix issues ::: :::note **React Native New Architecture:** The React Native team is actively evolving the New Architecture implementation with significant improvements in each release. We recommend using the latest available version of React Native when working with the New Architecture to benefit from the most recent stability and performance enhancements. ::: --- ## Testing (Web) Scanning happens against live camera frames delivered through the browser's `getUserMedia` API, then decoded internally using Web Workers, canvas, and WebAssembly. None of these are available in most unit test environments (Node, jsdom, happy-dom), so a unit test can never exercise the real decoding engine — only the code around it. The capture modes, sessions, and result objects the SDK hands to your listeners are also produced internally during a live scan, so they cannot be constructed with real data directly. Unlike on iOS and Android, the SDK's public types on Web are plain TypeScript classes and interfaces with no native bridge behind them, so there is no dedicated mocking framework to add — a plain object literal is enough to stand in for anything the SDK would otherwise hand your listener. There are two recommended approaches, which you can use on their own or combine: - **[Isolate the SDK behind your own abstraction](#isolate-the-sdk-behind-your-own-abstraction).** Keep your application logic independent of the SDK and test that logic directly, without any SDK objects. - **[Test with the SDK's own types directly](#test-with-the-sdks-own-types-directly).** Build plain objects that stand in for the capture mode, session, and result objects, then drive your listener with controlled values. Choose based on what you want to verify: your own logic in isolation, or your code's behavior against the SDK's own types. Both approaches test your callback logic in isolation. To verify the full pipeline end to end — the real, licensed engine actually decoding a frame — see [Integration testing your pipeline](#integration-testing-your-pipeline). :::note The examples on this page use BarcodeCapture. The same techniques apply to every capture mode; work with the corresponding listener and result types, for example `SparkScanListener`, `BarcodeBatchListener` (MatrixScan), or ID Capture's `Listener`. ::: ### Isolate the SDK Behind Your Own Abstraction With this approach the SDK is confined to a thin adapter, and your application logic depends only on an abstraction that you own. The example below routes every scan into a plain, testable type, so your tests never reference an SDK object. #### Define the abstraction and your application logic Declare an interface that exposes only the data your application needs from a scan, and put your logic in a type that depends on that interface. It never references `BarcodeCapture`, `BarcodeCaptureSession`, or `Barcode`. ```ts import type { Symbology } from '@scandit/web-datacapture-barcode'; // The app-facing abstraction — only what your logic needs. export interface BarcodeScanReceiver { onScan(data: string, symbology: Symbology): void; } // Your testable application logic. export class CartModel implements BarcodeScanReceiver { readonly scannedItems: string[] = []; onScan(data: string, symbology: Symbology): void { this.scannedItems.push(data); } } ``` `Symbology` is a plain string enum, so it's safe to use in your abstraction and to construct directly in tests. Only the capture mode, session, and result objects need to be kept out of your logic. #### Confine the SDK to a thin adapter Create a single adapter that implements `BarcodeCaptureListener`. This is the only piece of code that touches the capture session. It extracts plain values from the result and forwards them to your interface. ```ts import type { BarcodeCapture, BarcodeCaptureListener, BarcodeCaptureSession } from '@scandit/web-datacapture-barcode'; import type { FrameData } from '@scandit/web-datacapture-core'; import type { BarcodeScanReceiver } from './cart-model'; // The only code that depends on the live capture session. export function createBarcodeListener(receiver: BarcodeScanReceiver): BarcodeCaptureListener { return { didScan(barcodeCapture: BarcodeCapture, session: BarcodeCaptureSession, frameData: FrameData) { const barcode = session.newlyRecognizedBarcode; if (barcode?.data) { receiver.onScan(barcode.data, barcode.symbology); } }, }; } ``` #### Set up the scanner with your abstraction Wire up the context, settings, capture mode, camera, and view as usual — this follows the same sequence as [`BarcodeCaptureSimpleSample`](https://github.com/Scandit/datacapture-web-samples) — the only difference is that the listener comes from the adapter above. ```ts import { BarcodeCapture, BarcodeCaptureOverlay, BarcodeCaptureSettings, Symbology, barcodeCaptureLoader } from '@scandit/web-datacapture-barcode'; import { Camera, DataCaptureContext, DataCaptureView, FrameSourceState } from '@scandit/web-datacapture-core'; import { CartModel } from './cart-model'; import { createBarcodeListener } from './barcode-capture-adapter'; async function setupScanner(): Promise { // To visualize the ongoing loading process on screen, the view must be connected before the SDK finishes loading. const view = new DataCaptureView(); // Let the SDK select the best camera, and start the stream immediately so the preview appears as // soon as possible, without waiting for the SDK to finish loading. const camera = Camera.pickBestGuess(); await camera.applySettings(BarcodeCapture.recommendedCameraSettings); void camera.switchToDesiredState(FrameSourceState.On); view.connectToElement(document.getElementById('data-capture-view')!, { camera }); const context = await DataCaptureContext.forLicenseKey('-- ENTER YOUR SCANDIT LICENSE KEY HERE --', { libraryLocation: new URL('self-hosted-sdc-lib/', document.baseURI).toString(), moduleLoaders: [barcodeCaptureLoader()], }); // The view must be connected to the data capture context once it's ready. await view.setContext(context); await context.setFrameSource(camera); const settings = new BarcodeCaptureSettings(); settings.enableSymbologies([Symbology.EAN13UPCA, Symbology.Code128]); const barcodeCapture = await BarcodeCapture.forContext(context, settings); // Route results into your own logic through the adapter. const cartModel = new CartModel(); const listener = createBarcodeListener(cartModel); barcodeCapture.addListener(listener); // Add a default overlay to the view to visualize the scan process. await BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view); // Re-affirm the desired camera state now that it's wired to the context, matching the sample. await context.frameSource?.switchToDesiredState(FrameSourceState.On); } ``` #### Test your application logic Because the logic only depends on your interface, the test calls it directly. No camera, no capture session, and no capture mode are involved. ```ts import { describe, expect, it } from 'vitest'; import { Symbology } from '@scandit/web-datacapture-barcode'; import { CartModel } from './cart-model'; describe('CartModel', () => { it('adds a scanned item to the cart', () => { const cart = new CartModel(); cart.onScan('0123456789012', Symbology.EAN13UPCA); expect(cart.scannedItems).toEqual(['0123456789012']); }); }); ``` :::note The adapter and the scanner setup are not covered by unit tests, since they depend on a live capture session. Exercise them through [integration testing](#integration-testing-your-pipeline) instead. ::: ### Test With the SDK's Own Types Directly If you would rather test your existing code without restructuring it, build a plain object that stands in for whatever the SDK would hand your listener, and call the listener directly. #### What to build, and how | Type group | Examples | In a unit test | |---|---|---| | Listeners | `BarcodeCaptureListener`, `BarcodeBatchListener`, `SparkScanListener`, ID Capture's `Listener` | Implement directly with a plain object | | `FrameData` | `FrameData` | Plain object implementing the interface | | Modes | `BarcodeCapture`, `BarcodeBatch`, `SparkScan` | Not needed for listener tests — call the listener directly, no mode instance required | | Sessions | `BarcodeCaptureSession`, `BarcodeBatchSession`, `SparkScanSession` | Plain object with the properties your code reads | | Results | `Barcode`, `CapturedId` | Plain object with the properties your code reads | | Settings | `BarcodeCaptureSettings`, `IdCaptureSettings`, `SparkScanSettings` | Construct the real object — these have public constructors | :::note `BarcodeCaptureSession`, `BarcodeBatchSession`, and `Barcode` have no public way to populate real data — their fields are private and set only internally while processing an active scan. Build a plain object literal with the properties your code reads instead of trying to construct one of these classes; in TypeScript, cast it (`as unknown as BarcodeCaptureSession`) if the compiler objects to the shape. `SparkScanSession` is the one exception — its fields are public and can be assigned to directly, with no cast. ::: #### Barcode Capture ```ts import { describe, expect, it, vi } from 'vitest'; import { Symbology, type BarcodeCaptureListener, type BarcodeCaptureSession } from '@scandit/web-datacapture-barcode'; function createScanHandler(onScan: (data: string) => void): BarcodeCaptureListener { return { didScan(barcodeCapture, session, frameData) { const barcode = session.newlyRecognizedBarcode; if (barcode) { onScan(barcode.data); } }, }; } describe('createScanHandler', () => { it('forwards the scanned barcode data', () => { const onScan = vi.fn(); const listener = createScanHandler(onScan); const fakeSession = { newlyRecognizedBarcode: { data: '0123456789012', symbology: Symbology.EAN13UPCA }, } as unknown as BarcodeCaptureSession; listener.didScan(undefined, fakeSession, undefined); expect(onScan).toHaveBeenCalledWith('0123456789012'); }); }); ``` #### MatrixScan (Barcode Batch) `BarcodeBatchListener.didUpdateSession` receives a session exposing `trackedBarcodes`, `addedTrackedBarcodes`, and `removedTrackedBarcodes`. Stub the ones your code reads: ```ts import { describe, expect, it, vi } from 'vitest'; import type { BarcodeBatchListener, BarcodeBatchSession } from '@scandit/web-datacapture-barcode'; function createBatchHandler(onSeen: (values: string[]) => void): BarcodeBatchListener { return { didUpdateSession(barcodeBatch, session) { const values = session.addedTrackedBarcodes.map((tracked) => tracked.barcode.data); onSeen(values); }, }; } describe('createBatchHandler', () => { it('reports newly added tracked barcodes', () => { const onSeen = vi.fn(); const listener = createBatchHandler(onSeen); const fakeSession = { addedTrackedBarcodes: [{ barcode: { data: 'SKU-42' } }], } as unknown as BarcodeBatchSession; listener.didUpdateSession(undefined, fakeSession); expect(onSeen).toHaveBeenCalledWith(['SKU-42']); }); }); ``` #### ID Capture ID Capture's `Listener` methods mostly receive only the captured or rejected data, not the `IdCapture` instance itself, so most callbacks can be tested without an `IdCapture` at all: ```ts import { describe, expect, it, vi } from 'vitest'; import type { Listener } from '@scandit/web-datacapture-id'; import type { CapturedId } from '@scandit/web-datacapture-id'; function createIdHandler(onCaptured: (name: string) => void): Listener { return { didCaptureId(capturedId) { if (capturedId.fullName) { onCaptured(capturedId.fullName); } }, }; } describe('createIdHandler', () => { it('forwards the captured name', () => { const onCaptured = vi.fn(); const listener = createIdHandler(onCaptured); const fakeCapturedId = { fullName: 'Jane Doe' } as unknown as CapturedId; listener.didCaptureId?.(fakeCapturedId); expect(onCaptured).toHaveBeenCalledWith('Jane Doe'); }); }); ``` :::note `IdCapture` itself has a private constructor: it can only be produced via the asynchronous `IdCapture.forContext(context, settings)` factory, so it cannot be instantiated directly in a test. This does not block testing the listener above — only `didFailWithError(idCapture, error)` receives the `IdCapture` instance, and it is only passed through rather than called into, so a stub value is enough there. ::: #### SparkScan `SparkScanSession`'s fields are public, so — unlike the other session types — it can be constructed with `new SparkScanSession()` and assigned to directly, with no cast: ```ts import { describe, expect, it, vi } from 'vitest'; import { SparkScanSession, type SparkScanListener } from '@scandit/web-datacapture-barcode'; function createSparkScanHandler(onScan: (data: string) => void): SparkScanListener { return { didScan(sparkScan, session) { const barcode = session.newlyRecognizedBarcode; if (barcode) { onScan(barcode.data); } }, }; } describe('createSparkScanHandler', () => { it('forwards the scanned barcode data', () => { const onScan = vi.fn(); const listener = createSparkScanHandler(onScan); const fakeSession = new SparkScanSession(); fakeSession.newlyRecognizedBarcode = { data: '9782873334629' } as any; listener.didScan(undefined, fakeSession, undefined); expect(onScan).toHaveBeenCalledWith('9782873334629'); }); }); ``` ### Integration Testing Your Pipeline Chromium has a built-in way to feed a real file into `getUserMedia` without any library: `--use-fake-device-for-media-stream` together with `--use-file-for-fake-video-capture=.y4m` plays a `.y4m` video as the webcam. It only covers Chromium, though — Firefox and WebKit have no equivalent flag in Playwright — and it needs your test image pre-converted into a `.y4m` video rather than just pointing at a plain image file. [`@eatsjobs/media-mock`](https://github.com/eatsjobs/media-mock) covers the same need — a real image feeding the real decoding pipeline — consistently across all three engines, from a plain image URL: ```ts // e2e/fixtures.ts import { readFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import type * as MediaMockModule from '@eatsjobs/media-mock'; import type { Page } from '@playwright/test'; import { test as base } from '@playwright/test'; declare global { interface Window { MediaMock: typeof MediaMockModule; } } const dirname = path.dirname(fileURLToPath(import.meta.url)); const mediaMockUmdSource = readFileSync( path.resolve(dirname, '../node_modules/@eatsjobs/media-mock/dist/main.umd.js'), 'utf8' ); export type MediaMockDeviceName = keyof typeof MediaMockModule.devices; // Wraps @eatsjobs/media-mock's setup for a Playwright page: injecting the library, picking the // device profile to emulate, and pointing getUserMedia at a real image. export class MediaMockFacade { private readonly page: Page; private readonly mediaMockDevice: MediaMockDeviceName; public constructor(page: Page, mediaMockDevice: MediaMockDeviceName) { this.page = page; this.mediaMockDevice = mediaMockDevice; } public async inject(): Promise { await this.page.addInitScript({ content: mediaMockUmdSource }); } public async mock(): Promise { await this.page.addInitScript( async ({ device }: { device: MediaMockDeviceName }) => { // Playwright also runs init scripts against its internal about:blank setup navigation, // before the real page loads. There is no valid origin there to resolve a relative image // URL against, so skip it -- the script re-runs correctly on the real navigation. if (window.location.protocol !== 'https:' && window.location.protocol !== 'http:') { return; } const { MediaMock, devices } = window.MediaMock; MediaMock.mock(devices[device]); }, { device: this.mediaMockDevice } ); } public async setSource(imageUrl: string): Promise { await this.page.addInitScript(async ({ url }) => { const { MediaMock } = window.MediaMock; try { await MediaMock.setSource(url); } catch (error) { console.error('Failed to set media-mock source:', error); throw error; } }, { url: imageUrl }); } // Takes effect on the page's *next* navigation, like any addInitScript call -- call it before // a subsequent page.goto() within the same test, not after your assertions. Each Playwright // test already gets a fresh browser context by default, so most suites never need this between // tests; it matters only if you navigate more than once within a single test. public async unmock(): Promise { await this.page.addInitScript(() => { const { MediaMock } = window.MediaMock; MediaMock.unmock(); }); } } export interface MockedCameraFixtures { // Which media-mock device profile to emulate. Set per-project in playwright.config.ts (via // `use: { mediaMockDevice: ... }`) to match the real device the browser/engine combination is // standing in for -- media-mock only ships "iPhone 12", "Samsung Galaxy M53", and "Mac Desktop". mediaMockDevice: MediaMockDeviceName; mediaMockFacade: MediaMockFacade; } export const test = base.extend({ mediaMockDevice: ['Mac Desktop', { option: true }], mediaMockFacade: async ({ page, mediaMockDevice }, use) => { const mediaMockFacade = new MediaMockFacade(page, mediaMockDevice); await mediaMockFacade.inject(); await use(mediaMockFacade); }, }); export { expect } from '@playwright/test'; ``` ```ts // e2e/scan.spec.ts import { expect, test } from './fixtures'; test.describe('scanning a barcode with a mocked camera', () => { test.beforeEach(async ({ mediaMockFacade }) => { await mediaMockFacade.mock(); await mediaMockFacade.setSource('/ean13Upca_1234567890128.png'); }); test.afterEach(async ({ mediaMockFacade }) => { await mediaMockFacade.unmock(); }); test('scans a real barcode image through a mocked camera', async ({ page }) => { await page.goto('/'); await expect(page.getByText("Loading the Scandit Sdk...")).toBeVisible({ timeout: 20_000 }); await expect(page.getByText("1234567890128")).toBeVisible({ timeout: 20_000 }); await expect(page.locator("button", { hasText: "OK" })).toBeVisible({ timeout: 20_000 }); }); }); ``` Replace `ean13Upca_1234567890128.png` with your own test image, and the `getByText` assertion with whatever your app renders on a successful scan. #### Testing across browser engines and form factors media-mock ships exactly three device profiles: `"iPhone 12"`, `"Samsung Galaxy M53"`, and `"Mac Desktop"`. Map each Playwright project to whichever is the closest real device for that browser engine and form factor, using `mediaMockDevice` as a per-project option: ```ts // playwright.config.ts import { defineConfig, devices } from '@playwright/test'; import type { MockedCameraFixtures } from './e2e/fixtures'; export default defineConfig({ testDir: './e2e', projects: [ // WebKit stands in for Safari: iPhone on mobile, Mac on desktop. { name: 'Mobile Safari', use: { ...devices['iPhone 14'], mediaMockDevice: 'iPhone 12' } }, { name: 'Desktop Safari', use: { ...devices['Desktop Safari'], mediaMockDevice: 'Mac Desktop' } }, // Chromium and Firefox on mobile both stand in for Android -- media-mock has no separate // Firefox-for-Android profile. { name: 'Mobile Chrome', use: { ...devices['Pixel 7'], mediaMockDevice: 'Samsung Galaxy M53' } }, { name: 'Mobile Firefox', // Playwright has no mobile-Firefox device preset (Firefox for Android isn't a distinct // rendering engine Playwright can drive) -- approximate it with desktop Firefox at a phone // viewport and a Firefox-for-Android user agent. use: { browserName: 'firefox', viewport: { width: 412, height: 915 }, userAgent: 'Mozilla/5.0 (Android 14; Mobile; rv:132.0) Gecko/132.0 Firefox/132.0', mediaMockDevice: 'Samsung Galaxy M53', }, }, ], }); ``` `scan.spec.ts` needs no changes — the same test runs once per project, each with its own emulated device. #### Enabling WebGL Acceleration and Multithreading The SDK's engine uses WebGL for GPU-accelerated frame processing and, where the browser supports it, multithreaded WebAssembly for a further speedup. Neither is on by default under Playwright: headless browsers commonly run without real GPU access, and multithreading additionally requires the page itself to be cross-origin isolated, which most dev/preview servers don't set up out of the box. Neither gap fails a test outright — the SDK falls back to a slower path — so a suite can pass while silently exercising a code path your users' browsers never take. ##### WebGL Headless browsers typically disable or emulate the GPU rather than expose the real one, so WebGL needs to be forced on explicitly, through whatever mechanism your browser engine exposes via Playwright's `launchOptions`: - **Chromium-based browsers** take command-line flags via `launchOptions.args` — for example `--enable-webgl`, `--ignore-gpu-blocklist`, and `--disable-software-rasterizer`. The exact set worth passing depends on your Chromium version and CI environment; [Chromium's command-line switches reference](https://peter.sh/experiments/chromium-command-line-switches/) documents what's available. - **Firefox** doesn't take Chromium flags at all; use `launchOptions.firefoxUserPrefs` instead — e.g. `webgl.force-enabled` and `webgl.disable-fail-if-major-performance-caveat` — mirroring what you'd otherwise set in `about:config`. - **WebKit** generally needs nothing extra in Playwright's bundled build. ```ts // playwright.config.ts export default defineConfig({ projects: [ { name: 'chromium', use: { launchOptions: { args: ['--enable-webgl', '--ignore-gpu-blocklist', '--disable-software-rasterizer'] } }, }, { name: 'firefox', use: { launchOptions: { firefoxUserPrefs: { 'webgl.force-enabled': true, 'webgl.disable-fail-if-major-performance-caveat': true }, }, }, }, ], }); ``` Treat this as a starting point rather than a fixed list — confirm what your specific Playwright/Chromium version needs by checking whether WebGL is actually active, the same way you'd verify cross-origin isolation below. ##### Multithreading Multithreading needs the page to be [cross-origin isolated](https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated) (`SharedArrayBuffer` is otherwise unavailable). This is a property of the HTTP headers your web server sends, not something a Playwright launch option can turn on: configure whatever serves your app under test — your `webServer` command, or whatever it proxies to — with `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp` (or `credentialless` if the engine is loaded from a CDN). See [Improve Runtime Performance by Enabling Browser Multithreading](/sdks/web/matrixscan/get-started/#improve-runtime-performance-by-enabling-browser-multithreading) for the exact configuration across common server technologies, including Vite, which most Playwright `webServer` setups build on. Some engines gate `SharedArrayBuffer` behind an additional preference on top of the headers — for instance Firefox's `javascript.options.shared_memory`, set through `launchOptions.firefoxUserPrefs`. Check your target engine's equivalent if the check below confirms cross-origin isolation but multithreading still doesn't engage. Verify the setup actually took effect from inside the test, rather than assuming the headers or flags worked. `window.crossOriginIsolated` is the one universal, engine-agnostic signal Playwright can read without depending on your app: ```ts test('the page is cross-origin isolated', async ({ page }) => { await page.goto('/'); expect(await page.evaluate(() => window.crossOriginIsolated)).toBe(true); }); ``` The SDK itself checks more than that one flag — `BrowserHelper.checkMultithreadingSupport()` additionally confirms `SharedArrayBuffer` and nested Web Worker support, not just cross-origin isolation: ```ts import { BrowserHelper } from '@scandit/web-datacapture-core'; const supportsMultithreading = await BrowserHelper.checkMultithreadingSupport(); ``` This runs in the page, not in the Playwright test process, so call it from your own app code (the same way you would outside of testing) and surface the result somewhere your test can read it — a small on-page status element, a `data-*` attribute, or a value exposed on `window` for the test to pick up via `page.evaluate`. ### Tips and Pitfalls - Keep camera, `DataCaptureContext`, and view setup out of your unit tests — build only the plain objects your listener logic actually reads. - The SDK delivers listener callbacks asynchronously in production. Calling the listener directly in a test is synchronous, so if your own code hands work to another queue or awaits a promise, await it before asserting. - Prefer the isolation approach for new code — it keeps your tests independent of the SDK's types entirely. Reach for testing the SDK's types directly when retrofitting tests onto code that already implements a listener. --- ## WebView Integration The Scandit Web SDK can run inside a native WebView on Android and iOS. Because WebViews do not have direct access to device APIs, the native host application is responsible for requesting and delegating camera permissions to the web content. ### Secure Context Requirement Browsers — including WebView runtimes — only allow camera access in a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts). This means the web content must be served over HTTPS or from `localhost`. A plain `file://` URL is not a secure context and `getUserMedia` will fail. The recommended approach is to embed a lightweight local HTTP server in the native app and load the web content from `http://localhost:/`. This satisfies the secure context requirement without requiring a remote server. ### Android :::warning Android WebView does not support `SharedArrayBuffer` because its process model cannot provide the OS-level process isolation required to be [cross-origin isolated](https://developer.mozilla.org/en-US/docs/Web/API/crossOriginIsolated). This is an Android-specific limitation — iOS WKWebView supports cross-origin isolation since iOS 15.2. As a result, multithreading is unavailable on Android WebView and performance-intensive capture modes such as MatrixScan Batch and MatrixScan AR will run significantly slower than in a standard browser. See [Improve Runtime Performance by Enabling Browser Multithreading](./matrixscan/get-started.md#improve-runtime-performance-by-enabling-browser-multithreading) for context on what multithreading provides. If scanning performance is critical for your use case, consider these alternatives: - **Progressive Web App (PWA)**: a PWA runs in the device browser, which does support cross-origin isolation and multithreading, while still offering an app-like experience. - **Native Android SDK**: the [Scandit Android SDK](/sdks/android/add-sdk.md) runs entirely in native code and is not subject to any WebView or browser limitations. ::: #### 1. Declare the Camera Permission Add the `CAMERA` permission to your `AndroidManifest.xml`: ```xml ``` #### 2. Request Camera Permission at Runtime Request the OS-level camera permission before loading the WebView. Using the Activity Result Contracts API: ```kotlin # import android.Manifest # import android.content.pm.PackageManager # import android.os.Bundle # import androidx.activity.result.contract.ActivityResultContracts # import androidx.core.content.ContextCompat private val cameraPermission = registerForActivityResult( ActivityResultContracts.RequestPermission() ) { granted -> if (granted) { loadWebView() } else { // Handle denial — the web content cannot access the camera } } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED) { loadWebView() } else { cameraPermission.launch(Manifest.permission.CAMERA) } } ``` #### 3. Grant Camera Access to Web Content When the web SDK calls `getUserMedia`, the WebView triggers `WebChromeClient.onPermissionRequest`. Override this method to forward the permission to the web content. It is safe to grant automatically here because the native app has already received the OS camera permission in the previous step: ```kotlin # import android.webkit.PermissionRequest # import android.webkit.WebChromeClient webView.webChromeClient = object : WebChromeClient() { override fun onPermissionRequest(request: PermissionRequest) { val cameraResources = request.resources.filter { it == PermissionRequest.RESOURCE_VIDEO_CAPTURE }.toTypedArray() request.grant(cameraResources) } } ``` #### 4. Configure the WebView Enable JavaScript and allow media autoplay so the SDK can start the camera without requiring a user gesture: ```kotlin # import android.webkit.WebSettings # import android.webkit.WebView webView.settings.apply { javaScriptEnabled = true domStorageEnabled = true mediaPlaybackRequiresUserGesture = false } ``` #### 5. Serve Content from Localhost Load the web app from a local server to satisfy the secure context requirement: ```kotlin # import android.webkit.WebView webView.loadUrl("http://localhost:$port/") ``` A minimal implementation using [NanoHTTPD](https://github.com/NanoHttpd/nanohttpd) can serve static files from the APK's `assets/` folder. Make sure to include the correct MIME type for `.wasm` files (`application/wasm`) — without it, the browser will reject the Scandit engine files. For general guidance on serving the SDK's engine files, see [Hosting the `sdc-lib` files](./add-sdk.md#hosting-the-sdc-lib-files). ### iOS #### 1. Add the Camera Usage Description Add a camera usage description to your `Info.plist`: ```xml NSCameraUsageDescription Camera access is required for barcode scanning. ``` #### 2. Configure the WKWebView Enable inline media playback and allow media to start without a user gesture: ```swift import WebKit let configuration = WKWebViewConfiguration() configuration.allowsInlineMediaPlayback = true configuration.mediaTypesRequiringUserActionForPlayback = [] let webView = WKWebView(frame: .zero, configuration: configuration) webView.uiDelegate = self ``` #### 3. Handle the Media Capture Permission Request Implement `WKUIDelegate` to respond when the web SDK requests camera access. Tie the decision to the current `AVCaptureDevice` authorization status: ```swift import AVFoundation import WebKit func webView( _ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, decisionHandler: @escaping (WKPermissionDecision) -> Void ) { AVCaptureDevice.requestAccess(for: .video) { granted in DispatchQueue.main.async { decisionHandler(granted ? .grant : .deny) } } } ``` This delegate method is called every time the web content requests camera access. Calling `AVCaptureDevice.requestAccess` here triggers the system permission prompt on first launch, and returns immediately on subsequent calls based on the stored authorization status. #### 4. Pre-request the Camera Permission (Recommended) Requesting the native camera permission before loading the page results in a smoother user experience, because the system prompt appears immediately at app launch rather than mid-scan: ```swift override func viewDidLoad() { super.viewDidLoad() setupWebView() requestCameraPermission() loadContent() } private func requestCameraPermission() { AVCaptureDevice.requestAccess(for: .video) { _ in } } ``` #### 5. Load the Web Content Load a bundled HTML file or a local server URL. For bundled files, use `loadFileURL(_:allowingReadAccessTo:)` — note that `file://` URLs are not a secure context, so you must either serve from a local HTTP server or load the file with the SDK already initialized for a non-camera use-case. The simplest approach is to bundle the web app and load it directly: ```swift if let path = Bundle.main.path(forResource: "index", ofType: "html") { let url = URL(fileURLWithPath: path) webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) } ``` :::note `loadFileURL` grants the web content a secure context on iOS, so `getUserMedia` works even for `file://` URLs when loaded this way. ::: --- ## ShelfView [ShelfView](https://www.scandit.com/products/shelfview/) is integrated together with the Scandit team, so it has no public developer documentation. To integrate it, contact your Scandit account team or [support@scandit.com](mailto:support@scandit.com).