Skip to main content
Not sure which Scandit product fits your use case?

Install our data-capture-sdk skill so your coding agent can answer questions about Scandit products and recommend the right one for your use case, directly from your editor. More info →

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

npx skills add https://github.com/scandit/skills --skill data-capture-sdk

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

Installation

This page describes how to integrate the Scandit Data Capture SDK into your Capacitor project.

Prerequisites

  • Capacitor Version 5-7 and other related tools and dependencies.
  • A project with:
    • minimum iOS deployment target of 15.0 or higher
    • an Android project with target SDK version 24 (Android 7, Nougat) or higher
  • A valid Scandit Data Capture SDK license key. You can sign up for a free test account.
tip

Android devices running the Scandit Data Capture SDK need to have a GPU or the performance will drastically decrease.

Internal Dependencies

Some of the Scandit Data Capture SDK modules depend on others to work:

ModuleDependenciesOptional Dependencies
ScanditCaptureCoreNoneNone
ScanditBarcodeCaptureScanditCaptureCoreNone
ScanditParserNoneNone
ScanditIdCaptureScanditCaptureCoreScanditIdCaptureBackend
ScanditIdEuropeDrivingLicense
ScanditIdAamvaBarcodeVerification
ScanditIdVoidedDetection
tip

When using ID Capture, consult the ID Capture getting started guide to identify the optional dependencies required for your use case. The modules you need to include will vary based on the features you intend to use.

Please be aware that your license may only cover a subset of Barcode and/or ID Capture features. If you require additional features, contact us.

Get a License Key

  1. Sign up or Sign in to your Scandit account
  2. Create a project
  3. Create a license key

If you have a paid subscription, please reach out to Scandit Support if you need a new license key.

Add the SDK

Currently we support adding the Scandit Data Capture SDK Capacitor plugins to your project in two ways. The simplest way is to use the npm registry, alternatively you can manually download the plugins and add them to your project.

note

You should always make sure to add the scandit-capacitor-datacapture-core plugin, as all other plugins depend on it.

Create a new project

If you do not have a Capacitor project yet that you’ll use, you should create a new one.

npx cap init
npx cap add ios
npx cap add android

Add the SDK from npm

To add Scandit plugins via npm, run the corresponding commands from your project’s root folder.

In the following snippet we’re adding multiple plugins for different functionalities, but you can add only the ones you need as described in the Internal Dependencies section.

yarn add scandit-capacitor-datacapture-core
yarn add scandit-capacitor-datacapture-barcode
yarn add scandit-capacitor-datacapture-parser
yarn add scandit-capacitor-datacapture-id
note

You can also specify a version @<version>.

Add the SDK manually

After you download the archive containing all the plugins, unzip the archive. It includes the available Capacitor plugins, including the scandit-capacitor-datacapture-core plugin that all other plugins depend on.

First add the scandit-capacitor-datacapture-core plugin:

yarn add <path to scandit-capacitor-datacapture-core plugin>

Once this is done, you can continue with adding the plugin(s) for your desired functionality:

yarn add <path to scandit-capacitor-datacapture-barcode plugin>
yarn add <path to scandit-capacitor-datacapture-parser plugin>
yarn add <path to scandit-capacitor-datacapture-id plugin>

Update the project

After adding the plugins, you'll want to make sure they're added to your project properly.

For iOS, first set up Scandit's private CocoaPods repository:

Important: This project uses Scandit's private CocoaPods repository. First-time setup:

# Add Scandit's private CocoaPods repository (one-time setup)
pod repo add scandit-private-specs https://github.com/Scandit/scandit-cocoapods-specs.git

Then sync your project:

# iOS
npx cap sync

# Android
npx cap update android
npx cap sync
note

The public CocoaPods trunk repository is becoming read-only. Scandit has migrated to a private CocoaPods specs repository to ensure continued support and updates for iOS framework integrations. The repository is publicly accessible at https://github.com/Scandit/scandit-cocoapods-specs.

Troubleshooting: If you encounter issues:

  • Verify the repo is added: pod repo list | grep scandit-private-specs
  • Update the repo: pod repo update scandit-private-specs

Additional Information

Android Configuration

On Android, the Scandit SDK uses content providers to initialize the scanning capabilities properly. If your own content providers depend on the Scandit SDK, choose an initOrder lower than 10 to make sure the SDK is ready first.

If not specified, initOrder is zero by default and you have nothing to worry about.

Check the official <provider> documentation.

Camera Permissions

When using the Scandit Data Capture SDK you will want to set the camera as the frame source for various capture modes. The camera permissions are handled by the plugins, so you don’t need to specify anything explicitly.

Third-party Licenses

The Scandit Data Capture SDK relies on several third-party, open-source software libraries. Your application must display the license information for these libraries in many cases.

The Scandit SDK provides a convenient API that you can use to fetch the corresponding text and attributions for all third-party software:

  • DataCaptureContext.getOpenSourceSoftwareLicenseInfo()