React Native

React Native Barcode Scanner SDK

Integrate barcode scanning into React Native apps using the barKoder React Native Barcode Scanner SDK. Support Android and iOS with one integration while accessing continuous scanning, Batch MultiScan, difficult barcode decoding, VIN, MRZ, PDF417 and DPM features.

react native barcode scanner

barKoder Barcode Scanner SDK for React Native

The barKoder React Native package is available through npm and connects JavaScript/TypeScript applications with the native Android and iOS scanning engines. You add one component, BarkoderView, and the same code scans on both platforms.

What the React Native barcode reader handles

  • 30+ 1D and 2D symbologies
  • QR Code and Micro QR Code
  • Damaged and blurry barcodes
  • Deformed 1D barcodes
  • Batch MultiScan
  • Continuous scanning
  • VIN barcodes
  • MRZ on passports and IDs
  • PDF417 on licenses and IDs
  • DPM Data Matrix
  • DotCode
  • Barcodes in gallery images

Test it on the barcodes your users actually scan. A trial license runs for 30 days on up to 25 devices.

Start a free trial

Add a React Native barcode scanner to your app

  1. Install barkoder-react-native with npm or yarn. If iOS gives you trouble, run pod install in the ios folder.
  2. Import Barkoder and BarkoderView and add the view to your screen with your license key.
  3. In onBarkoderViewCreated, enable the barcode types you need.
  4. Call startScanning and handle the result in its callback.
  5. On iOS, add a camera usage description to Info.plist. The package sets the Android camera permission for you.
Open the React Native installation guide

React Native barcode scanner example

Code from the barKoder React Native docs. The excerpts below come from the general example, which builds a complete scanner screen with start and stop buttons.

1. Install the package
Shell
npm install barkoder-react-native
2. Reinstall iOS dependencies if needed
Shell
cd ios
pod install
3. Import the package
JavaScript
import { Barkoder, BarkoderView } from 'barkoder-react-native';
4. Configure the scanner and start scanning (excerpt)
JavaScript
  const onBarkoderViewCreated = async (_barkoder) => {
    try {
      await _barkoder.setBarcodeTypeEnabled(Barkoder.BarcodeType.qr, true);
      await _barkoder.setRegionOfInterestVisible(true);
      await _barkoder.setZoomFactor(2.0);
      setBarkoder(_barkoder);
    } catch (error) {
      console.error('Error initializing Barkoder:', error);
      Alert.alert('Error', 'Failed to initialize Barkoder');
    }
  };

  const startScanning = () => {
    if (!barkoder) return;

    setIsScanning(true);
    barkoder.startScanning((result) => {
      setScannedResult({
        textualData: result.textualData,
        type: result.barcodeTypeName,
        thumbnailImage: "data:image/jpeg;base64," + result.resultThumbnailAsBase64,
      });
      setIsScanning(false);
    }, (error) => {
      console.error('Scanning error:', error);
      Alert.alert('Error', 'Scanning failed');
      setIsScanning(false);
    });
  };
5. Render BarkoderView with your license key (excerpt)
JSX
      <BarkoderView
        style={styles.barkoderView}
        licenseKey="ADD_YOUR_LICENSE_KEY_HERE"
        onBarkoderViewCreated={onBarkoderViewCreated}
      />
6. iOS camera permission in Info.plist
XML
<key>NSCameraUsageDescription</key>
<string>Camera permission</string>

See the full React Native general example and every method in the React Native API reference.

Read the barcodes your users struggle with

Each feature below is documented for React Native. Where the docs give a short setting, it is shown here so you can add it to onBarkoderViewCreated.

Damaged, deformed and blurry barcodes

MatrixSight®, Segment Decoding, DeBlur

MatrixSight reads QR and Data Matrix codes that are missing their finder, timing or alignment patterns. Segment Decoding reads 1D barcodes that are crumpled, wrinkled or on curved surfaces. DeBlur reads EAN and UPC barcodes affected by motion, lens or focus blur.

How MatrixSight reads damaged codes →

Batch MultiScan and continuous scanning

Many barcodes in one session

Scan multiple barcodes of any type and density continuously, with result caching to keep results stable while the camera moves.

JavaScript
_barkoder.setCloseSessionOnResultEnabled(false);
_barkoder.setMaximumResultsCount(200);
_barkoder.setMulticodeCachingDuration(3000);
_barkoder.setMulticodeCachingEnabled(true);
Enable MultiScan in React Native →

VIN scanning

Code 39, Code 128, QR Code and Data Matrix

VIN mode combines MatrixSight and Segment Decoding to read the barcodes that carry Vehicle Identification Numbers. OCR VIN support is documented separately.

JavaScript
_barkoder.setEnableVINRestrictions(true);
Enable VIN scanning in React Native →

PDF417 on licenses and ID cards

PDF417-LineSight® and the SA DL parser

LineSight reads PDF417 barcodes that are missing their start and stop patterns, row indicators or even whole data columns. For South African driving licenses, ID cards and vehicle license discs, the SA DL parser turns the barcode into structured fields on the device.

Enable the South African parsers in React Native →

DPM Data Matrix

Direct Part Marking

DPM mode is a scanning template for Data Matrix codes engraved or etched onto parts, built for low contrast, poor lighting and surface damage.

See the React Native DPM example →

Scanning images and AR overlays

Gallery scan and AR Mode

Scan barcodes in an image the user picks from the gallery, or use AR Mode to show barcode data over the scanned items in the camera view.

Enable gallery scanning in React Native →

React Native MRZ scanner

Read the Machine Readable Zone on passports, ID cards and travel documents with the same package you use for barcodes. MRZ scanning runs locally on the device in real time.

What you get from the MRZ

  • Name
  • Date of birth
  • Document number
  • Personal number
  • Date of expiry
  • Optional data

Use it in identity verification flows where users would otherwise type document data by hand.

Explore MRZ scanning

Enable MRZ in React Native

Turn on the ID document type in your onBarkoderViewCreated callback:

JavaScript
_barkoder.setBarcodeTypeEnabled(Barkoder.BarcodeType.idDocument, true);
Enable MRZ mode in React Native

VisionCamera, expo-camera or a React Native barcode scanner SDK?

Many React Native barcode projects start with the code scanner in react-native-vision-camera or with expo-camera. Both are free and work well for many apps. Here is when a dedicated SDK is worth testing.

A free camera library fits when

  • You scan clean QR codes and common retail barcodes
  • VisionCamera's ML Kit-based scanner or expo-camera's built-in detection reads your samples well
  • The format list covers you: expo-camera lists 13 barcode types
  • On iOS you only need to scan QR codes from images, which is what expo-camera's image scanning supports there

barKoder fits when

  • Labels are damaged, wrinkled, blurred or on curved surfaces
  • You read dense PDF417 on licenses and ID cards
  • You need a React Native MRZ scanner or VIN scanning in the same package
  • You scan DPM codes engraved on parts
  • You count many barcodes at once with Batch MultiScan
  • You need formats such as DotCode, Telepen or MSI Plessey
  • You want direct developer support from the team that builds the engine

Run each option on the same samples and devices, and count failed and repeated scans as well as successful reads.

Requirements and documentation

What you need

  • React Native 0.70 or later and React 18.1.0 or later
  • Android 5.0 (API 21) or later
  • iOS 15.0 or later
  • A Mac with Xcode to build the iOS app
  • A barKoder license key. Without one, scan results come back marked (Unlicensed) and only partly readable.

The package source is written in TypeScript, so its types are available in your editor.

One scanning engine for React Native and every other platform

The same barKoder engine is available as native SDKs for Android and iOS and as plugins for other cross-platform frameworks, so you can reuse the setup across your apps.

  • 7 native & desktop SDKs
  • 6 cross-platform integrations
  • One consistent scanning core

barKoder in production

Teams that replaced open-source scanners with barKoder, including a React Native app for iOS and Android.

The Dealer Plate

Automotive · React Native

Under 10 sinstead of about 2 minutes of manual entry

Integrated the barKoder React Native plugin to support iOS and Android from one codebase, including dense PDF417 barcodes on ordinary smartphones.

We integrated the React Native SDK into both our iOS and Android apps in short order, and scanning went from the flaky part of our product to a feature our dealers just trust.Seth Hudman, The Dealer Plate
Read The Dealer Plate story →

Method

USA · Dental e-procurement

Replaced an open-source scanner after evaluating more than eight solutions. Started in the browser with WebAssembly, with the option to move to a native or React Native implementation later.

The product delivers exactly what it promises—fast, reliable scanning—while the team behind it is responsive and committed to customer success.Willie Doyle, CTO, Method Procurement Technologies
Read the Method story →

Try barKoder on your phone or in your browser

Install the free barKoder demo app, or open the web demo, and scan your own barcodes before you integrate the SDK.

iPhone and iPad

barKoder demo app for iOS

Scan with your camera, or point it at the QR code to open the App Store.

Download on the App Store
QR code linking to the barKoder demo app on the App Store

Android phones and tablets

barKoder demo app for Android

Scan with your camera, or point it at the QR code to open Google Play.

Get it on Google Play
QR code linking to the barKoder demo app on Google Play

Any modern browser

barKoder web demo

Runs the Web SDK in your browser, on desktop or mobile, with nothing to install.

Open the web demo
QR code linking to the barKoder web demo

Test with known samples. Print or display the testing sheet and scan each 1D and 2D barcode with the demo app. The data sheet summarizes the SDK for your team.

React Native barcode scanner questions

What is the best barcode scanning SDK for React Native apps?

It depends on what you scan. For clean QR codes and retail barcodes, a free option such as the VisionCamera code scanner or expo-camera may be enough. If your users scan damaged labels, dense PDF417, DPM marks, MRZ or VIN, or many barcodes at once, test a React Native barcode scanner SDK such as barKoder on your own samples with a free trial license.

How do I install the barKoder React Native package?

Run npm install barkoder-react-native or yarn add barkoder-react-native. If iOS gives you trouble, run pod install inside the ios folder. The React Native installation guide covers each step.

Which React Native, Android and iOS versions are supported?

The package requires React Native 0.70 or later and React 18.1.0 or later. Apps must target Android 5.0 (API 21) or later and iOS 15.0 or later.

How is barKoder different from react-native-vision-camera and expo-camera?

Those are free camera libraries with built-in barcode detection. barKoder is a dedicated scanning SDK with its own engine: MatrixSight, Segment Decoding, DeBlur and PDF417-LineSight for difficult codes, plus MRZ, VIN, DPM and Batch MultiScan modes and developer support. barKoder needs a commercial license; see pricing.

Can I build a React Native MRZ scanner with barKoder?

Yes. Enable the ID document barcode type to read the MRZ on passports, ID cards and travel documents. See how to enable MRZ mode in React Native.

Does scanning need an internet connection?

Scanning runs locally on the device. The SDK goes online only for the license check, and each device must reach the licensing server at least once every 30 days.

What happens if I run the SDK without a license key?

The scanner still works, but results come back marked (Unlicensed) and only partly readable. Register on the barKoder portal to generate a trial license, which runs for 30 days on up to 25 devices. Use trial licenses in development and staging only.

Is there a demo app I can try first?

Yes. The Barcode Scanner by barKoder app shows the supported formats and includes a DPM scanning template. Get it on the App Store or Google Play.

Add barcode scanning to your React Native app

Test barKoder on your own barcodes and devices with a free 30-day trial, or talk to an SDK expert about your project.