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 guide shows you how to add the Scandit Data Capture SDK to your existing project.

Prerequisites

  • The latest stable version of React Native CLI and other related tools and dependencies.
  • A project with:
    • minimum node version of 18 or higher.
    • minimum iOS deployment target of 15.0 or higher
    • an Android project with target SDK version 23 (Android 6, Marshmallow) or higher (version 24 or higher for ID Capture)
  • 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

Certain Scandit Data Capture SDK modules have package dependencies.

ModuleDependenciesOptional Dependencies
scandit-react-native-datacapture-coreNoneNone
scandit-react-native-datacapture-barcodescandit-react-native-datacapture-coreNone
scandit-react-native-datacapture-idscandit-react-native-datacapture-corescandit-react-native-datacapture-id-europe-driving-license
scandit-react-native-datacapture-id-aamva-barcode-verification
scandit-react-native-datacapture-id-voided-detection
scandit-react-native-datacapture-parserNoneNone
scandit-react-native-datacapture-labelscandit-react-native-datacapture-core
scandit-react-native-datacapture-barcode
scandit-react-native-datacapture-label-text
scandit-react-native-datacapture-price-label
tip

When using ID Capture or Label Capture, consult the respective module's getting started guides 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

Choose your preferred installation method below. Installing from the package registry is simpler and recommended for most users, while manual installation gives you more control over the SDK version.

tip

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

Create a new project

If you do not have a React Native project yet that you'll use, you should create a new one.

react-native init HelloScandit
cd HelloScandit

Install from Package Registry

To add Scandit plugins from the package registry, run the corresponding commands from your project's root folder.

Install the core plugin (required):

yarn add scandit-react-native-datacapture-core

Then add the plugin(s) for your desired functionality:

# For barcode scanning
yarn add scandit-react-native-datacapture-barcode

# For ID capture
yarn add scandit-react-native-datacapture-id

# For label capture
yarn add scandit-react-native-datacapture-label
tip

You can add only the plugins you need as described in the Internal Dependencies section. You can also specify a version @<version>.

Additional steps on iOS

  1. Camera permissions are required to stream the frame source data into various capture modes. You need to set the “Privacy - Camera Usage Description” field in the Info.plist file for iOS.
<key>NSCameraUsageDescription</key>
<string>Access to the camera is required for scanning.</string>

Info file

  1. Then, install the iOS CocoaPods after installing the React Native node_modules.

    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, install the CocoaPods dependencies:

    cd ios && pod install && cd ..
    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 Content Providers

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. On Android, you have to request camera permissions in your own application before starting scanning. To see how you can achieve this, take a look at our samples.

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()