Adding barcode scanning to a Cordova application allows users to read QR codes and product barcodes directly through a mobile device’s camera. This feature is useful in inventory systems, retail applications, warehouse software, ticketing platforms, and other mobile projects that need to capture encoded information quickly.
A barcode scanner plugin Cordova integration connects JavaScript code with native Android or iOS scanning capabilities. Instead of building a camera-processing system from scratch, developers can use an existing plugin or commercial SDK to handle barcode detection and return the scanned data to the application.
However, choosing the right plugin requires more than checking whether it can read a QR code. You should also consider platform compatibility, supported barcode formats, maintenance activity, camera permissions, licensing, and the Cordova version used by your project.
This guide compares popular Cordova barcode-scanning options, explains how to install a plugin, provides a JavaScript example, and covers common integration problems.
What Is a Barcode Scanner Plugin for Cordova?
A Cordova barcode scanner plugin is a software component that lets a hybrid mobile application use the device camera to recognize barcodes. It connects the JavaScript layer of a Cordova app with native scanning functionality on Android or iOS.
Cordova applications are primarily developed with HTML, CSS, and JavaScript. Plugins provide access to native device features that ordinary web code cannot use directly in the same way.
A barcode scanner plugin typically handles these tasks:
- Opens the device camera.
- Detects a barcode or QR code in the camera view.
- Decodes the information stored in the code.
- Returns the result to JavaScript.
- Reports errors or unsuccessful scanning attempts.
The application can then use the decoded value to look up a product, retrieve an inventory record, validate a ticket, or perform another task.
Best Barcode Scanner Plugins for Cordova
Several projects and SDKs offer barcode-scanning functionality for Cordova. They differ in their underlying scanning engines, platform support, documentation, licensing, and maintenance status.
The best choice depends on whether you need a basic scanner, a maintained open-source option, or an advanced commercial solution.
1. ReadyOp Cordova Barcode Scanner
The ReadyOp repository provides a Cordova plugin that uses Google ML Kit Vision on Android and Apple’s AVCaptureSession on iOS.
It supports Android and iOS/iPadOS and documents barcode formats such as QR Code, EAN-13, EAN-8, Code 128, Code 39, UPC-A, UPC-E, Data Matrix, PDF417, and Aztec.
The repository provides a JavaScript method that accepts scanner options and success and failure callbacks.
Useful features:
- Android and iOS support.
- ML Kit-based Android scanning.
- Native iOS camera capture.
- Configurable barcode formats.
- Optional flashlight button.
- Optional success sound and vibration.
- A result containing the decoded text and barcode format.
Important consideration: Check the repository’s current activity, dependencies, and build compatibility before using it in a production application. A documented installation command is not proof that a plugin has been tested with every recent Cordova release.
2. Seamlink QR Code and Barcode Scanner
The Seamlink package provides QR code and barcode scanning through a Cordova plugin interface. Its documentation describes Android and iOS support and exposes scan and encode methods.
The package is published under the name @seamlink/cordova-plugin-qrcode-barcode-scanner.
Useful features:
- npm package distribution.
- QR code and barcode scanning.
- Callback-based JavaScript API.
- Barcode encoding methods.
- Android and iOS support described in its documentation.
Important consideration: Its README warns that installation directly from the repository URL is unstable and includes older Android support-library configuration. Review the current package files and test the plugin against your Cordova platform versions before adopting it.
3. Red Mobile Barcode Scanner Plugin
The Red Mobile package is another option for developers working with Cordova applications. Its package documentation describes scanning functionality, supported barcode formats, and callback-based usage.
It may be worth investigating when maintaining an existing project that already depends on this plugin.
Important consideration: Its documentation references Cordova 10. Check the exact package version and platform support before using it in a newer application.
4. Mobisys ML Kit Barcode Scanner
The Mobisys project provides an ML Kit-based barcode-scanning implementation for Cordova. Its documentation includes installation information, barcode formats, and Android-related configuration details.
It is useful as a technical reference for developers studying ML Kit integration.
Important consideration: GitHub marks this repository as archived on February 19, 2025. An archived project is no longer maintained through normal repository development, so it should not be the default choice for a new production application unless you plan to maintain a fork or have verified a suitable maintained alternative.
5. barKoder Cordova Barcode Scanner SDK
barKoder offers a commercial barcode-scanning SDK with a dedicated Cordova integration.
Its documentation covers installation, configuration, scanner examples, and advanced features. Depending on the selected SDK configuration, developers can implement workflows such as continuous scanning, multiple barcode capture, gallery scanning, and specialized barcode recognition.
Useful features:
- Dedicated Cordova documentation.
- Android and iOS integration.
- Examples and API references.
- Multiple barcode formats.
- Advanced scanning workflows.
- Commercial support and licensing options.
Important consideration: Review the licensing model, current minimum platform requirements, and feature availability before choosing it for a commercial application.
6. Scandit Cordova Barcode Scanner SDK
Scandit provides a commercial barcode-scanning SDK for Cordova developers who need advanced scanning capabilities.
Its documentation covers integration, supported barcode formats, scanner interfaces, and developer resources. The platform is aimed particularly at applications where scanning quality, user experience, and business workflows are important.
Useful features:
- Dedicated developer documentation.
- Advanced barcode-scanning workflows.
- Support for business and enterprise applications.
- Customizable scanning experiences.
- Integration guidance and sample projects.
Important consideration: Scandit is a commercial solution. Review its licensing, pricing, and feature requirements to determine whether it is appropriate for your project.
Cordova Barcode Scanner Plugin Comparison
The following table highlights the main differences between the options discussed above.
| Plugin or SDK | Main approach | Platform information | Best suited for |
|---|---|---|---|
| ReadyOp | ML Kit on Android and AVCaptureSession on iOS | Android and iOS | Developers evaluating an open-source-style Cordova implementation |
| Seamlink | Cordova scanning plugin | Android and iOS listed | Existing projects or developers testing its npm package |
| Red Mobile | Cordova barcode scanner | Verify exact version | Existing applications using this package |
| Mobisys ML Kit | ML Kit-based plugin | Repository documentation | Technical reference or maintained forks |
| barKoder | Commercial scanning SDK | Android and iOS | Advanced scanning workflows |
| Scandit | Commercial scanning SDK | Cordova SDK documentation | Enterprise and business scanning applications |
This comparison is not a claim that every package is equally maintained or compatible with current Cordova versions. Check each project’s latest release, repository activity, dependencies, and platform requirements before installation.
How to Install a Barcode Scanner Plugin in Cordova
The installation process depends on the plugin you select. The following example uses the installation command documented by the ReadyOp repository.
Step 1: Check Your Cordova Project
Open a terminal in your Cordova project directory.
Check your installed Node.js and npm versions:
node -v
npm -v
You can also check your Cordova CLI version:
cordova -v
Review the Android and iOS platform versions used by your project. Plugin compatibility can depend on the native platform packages as well as the Cordova CLI.
Step 2: Add the Barcode Scanner Plugin
The ReadyOp repository documents this installation command:
cordova plugin add cordova-plugin-barcode-scanner
Run the command from your project directory.
If installation fails, inspect the error output and verify that the package can be resolved, its dependencies are available, and your installed Cordova platforms meet its requirements.
Step 3: Confirm That the Plugin Is Installed
Use the Cordova plugin listing command:
cordova plugin ls
Check that the scanner plugin appears in the output.
You should also inspect the project’s plugin and platform configuration before building the application.
Step 4: Build the Target Platform
For Android:
cordova build android
For iOS:
cordova build ios
Building for iOS requires a compatible macOS and Xcode development environment. Test the resulting application on a real device as well as an emulator where appropriate.
How to Use a Barcode Scanner Plugin in Cordova

After installation, the application can call the plugin’s JavaScript interface. The exact API depends on the selected package.
The ReadyOp repository documents the method cordova.plugins.barcodeScanner.scan() with scanner options, a success callback, and a failure callback.
Basic JavaScript Example
The following example demonstrates the documented callback pattern:
document.addEventListener("deviceready", function () {
const options = {
beepOnSuccess: true,
showTorchButton: true,
vibrateOnSuccess: false,
formats: {
QRCode: true,
EAN13: true,
EAN8: true,
Code128: true,
Code39: true,
UPCA: true,
UPCE: true,
PDF417: false,
Aztec: true,
DataMatrix: true
}
};
cordova.plugins.barcodeScanner.scan(
options,
function (result) {
console.log("Scanned value:", result.text);
console.log("Barcode format:", result.format);
document.getElementById("scan-result").textContent =
result.text;
},
function (error) {
console.error("Barcode scanning failed:", error);
}
);
});
This example assumes that the selected plugin exposes the ReadyOp API and that an element with the ID scan-result exists in the page.
The deviceready event is important because Cordova plugins are not guaranteed to be available before the native bridge has initialized.
Understanding the Scan Result
The ReadyOp README describes a result with two fields:
| Field | Meaning |
|---|---|
text | The decoded barcode content |
format | The detected barcode format |
For example, a successful scan might return a product identifier in text and EAN13 in format.
Your application can use these values to search a product database, display item details, validate a shipment, or save a transaction.
Always verify the exact return structure and cancellation behavior of the plugin version installed in your project.
Supported Barcode Formats
Different scanner plugins support different barcode symbologies. Before choosing one, confirm that it can read the formats used by your application.
Common 1D Barcode Formats
One-dimensional barcodes store information using patterns of parallel lines and spaces.
Common examples include:
- EAN-13: Frequently used on retail products.
- EAN-8: A shorter retail barcode format.
- UPC-A: Commonly used for product identification.
- UPC-E: A compressed UPC format.
- Code 39: Used in inventory and industrial applications.
- Code 128: Used for logistics, shipping, and business identification.
- Codabar: Found in certain specialized applications.
- ITF: Often used for packaging and logistics.
Common 2D Barcode Formats
Two-dimensional codes store data in a pattern that can be read horizontally and vertically.
Examples include:
- QR Code: Used for links, payments, contact information, and other data.
- Data Matrix: Common in manufacturing and product identification.
- PDF417: Used in documents, identification, and transport applications.
- Aztec: Used in transport and ticketing systems.
A plugin may support a format on one platform but not another. Compare its Android and iOS support tables rather than assuming they are identical.
Camera Permissions for Cordova Barcode Scanning
Barcode scanning requires access to the device camera. Permission configuration is therefore an essential part of integration.
Android Camera Permission
Android applications must declare and obtain camera permission according to the target Android version and the plugin’s implementation.
Check the plugin’s native configuration and the generated Android manifest. If the application requests permission at runtime, make sure the user-facing flow explains why camera access is needed.
iOS Camera Permission
iOS applications that access the camera need an appropriate camera usage description in the app’s Info.plist.
For Cordova projects, confirm that the required NSCameraUsageDescription entry is present in the generated iOS application configuration.
Use a clear explanation, such as:
“The camera is used to scan product barcodes and QR codes.”
The exact configuration method depends on the plugin and Cordova iOS project setup. Do not assume that installing a scanner plugin automatically configures every permission required by your application.
How to Choose the Right Cordova Barcode Scanner Plugin
Selecting a plugin should start with your application’s requirements rather than the number of features listed on a product page.
1. Check Platform Compatibility
Confirm that the plugin supports the Android and iOS versions you intend to target. Review its required Cordova platform versions, native dependencies, and build tools.
2. Verify Barcode Format Support
Make a list of the formats your application needs. A retail inventory app may primarily need EAN and UPC, while a document or transport application may require PDF417 or Aztec.
3. Review Maintenance Activity
Look at the repository’s latest commits, releases, open issues, dependency updates, and archived status.
A package that was published recently may still rely on old native dependencies. Conversely, an older package may continue to work in a fixed environment but require careful testing.
4. Compare Licensing
Open-source plugins may be suitable for simple applications, but you may need to maintain the code yourself.
Commercial SDKs can provide advanced scanning features, vendor support, and licensing arrangements. Check the terms before using one in a commercial product.
5. Test on Real Devices
Camera behavior can differ between devices. Test scanning with the actual phone models, barcode labels, lighting conditions, and camera orientations expected in your application.
6. Consider Future Maintenance
Choose an option that your development team can maintain. If a plugin is no longer updated, consider whether you can safely fork it, replace it, or migrate to a different framework.
Common Problems With Cordova Barcode Scanner Plugins
Even after successful installation, developers may encounter issues during testing or deployment.
Plugin Is Not Available
If JavaScript reports that cordova.plugins.barcodeScanner is undefined, check that:
- The plugin installation completed successfully.
- The application is running inside the Cordova native container.
- Your code waits for
deviceready. - The application was rebuilt after installing the plugin.
- The installed plugin exposes the API name used in your code.
Camera Permission Is Denied
If the scanner cannot open the camera, inspect the Android permission flow or the iOS camera usage description.
Users may deny camera access, so the application should display a helpful explanation and provide an appropriate route to device settings where supported.
Android or iOS Build Fails
Build errors can result from incompatible Gradle versions, Android SDK requirements, Xcode settings, CocoaPods dependencies, or outdated native plugin code.
Read the complete build log and compare the installed versions with the plugin’s documented requirements. Avoid changing several build dependencies at once because doing so can make the underlying problem harder to identify.
Barcode Is Not Recognized
A scanner may fail to read a code because:
- The image is blurred.
- The barcode is damaged.
- The lighting is insufficient.
- The camera is too close or too far away.
- The selected barcode format is disabled.
- The barcode uses an unsupported encoding or structure.
Test with several known-good examples of each required format.
Camera Appears Upside Down
Some devices may report camera orientation differently. The ReadyOp documentation describes a rotateCamera option for a listed device issue.
Use orientation settings only when supported by your selected plugin, and verify the behavior on the actual device.
Repeated Scans Return the Same Value
In continuous-scanning workflows, the same barcode may be detected in multiple camera frames.
Your application may need duplicate detection, a short processing lock, or a scan-session rule. Use the plugin’s documented continuous-scanning controls if available.
Is a Cordova Barcode Scanner Plugin Free?
Some Cordova barcode scanner projects are distributed under open-source licenses, while commercial SDKs use paid licensing models.
For example, the ReadyOp repository identifies an MIT license. Commercial options such as Scandit and barKoder provide their own licensing arrangements.
Before selecting a plugin, check:
- The exact license of the package version.
- Whether commercial use is permitted.
- Whether attribution or distribution conditions apply.
- Whether advanced features require a paid license.
- Whether support and updates are included.
Do not assume that a package is free for every type of commercial deployment simply because its source code is publicly available.
Frequently Asked Questions
Which barcode scanner plugin is best for Cordova?
There is no single best option for every application. Compare platform compatibility, supported formats, maintenance activity, licensing, and the features your app needs. ReadyOp provides a documented Android and iOS implementation, while Scandit and barKoder offer commercial SDK options.
Can Cordova scan QR codes?
Yes. A Cordova application can scan QR codes through a compatible native barcode-scanning plugin or SDK. The plugin uses the device camera and returns the decoded content to the JavaScript application.
How do I install a barcode scanner plugin in Cordova?
Use the installation command provided by the selected plugin. For the ReadyOp repository, the documented command is:
cordova plugin add cordova-plugin-barcode-scanner
After installation, rebuild the required platform and test the scanner on a device.
Does a Cordova barcode scanner work on Android and iOS?
Some plugins support both platforms, while others have limited or different platform support. Check the documentation for the exact version you plan to install and verify its supported Android and iOS requirements.
Can a Cordova barcode scanner work offline?
Many mobile scanning engines can decode barcodes locally on the device without sending each image to a remote server. However, licensing checks, application features, or backend lookups may still require network access. Confirm the behavior of the selected SDK.
What is the difference between a barcode scanner plugin and a barcode scanner SDK?
A plugin connects native functionality to a framework such as Cordova. An SDK is a broader development package that may include scanning engines, APIs, UI components, configuration tools, and vendor support. Some commercial SDKs also provide Cordova plugins.
Why is the Cordova barcode scanner not opening the camera?
Possible causes include missing camera permission, an absent iOS usage description, plugin installation problems, incorrect initialization timing, or a native build issue. Check the device permission settings and the complete build output.
Can I use a Cordova barcode scanner with Ionic?
Yes, Ionic applications using Cordova can use compatible Cordova plugins. Confirm that the plugin supports the project’s runtime and platform versions. An Ionic application built with Capacitor may require a Capacitor-compatible integration instead.
Is the Mobisys ML Kit Cordova plugin still maintained?
GitHub marks the Mobisys repository as archived on February 19, 2025. Developers should treat it as an archived project and investigate a maintained alternative or fork before using it in a new production application.
Final Thoughts
A barcode scanner plugin for Cordova can add useful scanning functionality to mobile applications without requiring developers to build a complete barcode-recognition system themselves.
The right choice depends on your target platforms, required barcode formats, project dependencies, licensing needs, and long-term maintenance plans. A lightweight plugin may be sufficient for basic QR and product-code scanning, while a commercial SDK may be more suitable for complex business workflows.
Before committing to a package, review its repository activity, test its installation in a clean Cordova project, confirm camera permissions, and scan real examples on your target devices. These checks can help prevent compatibility problems and make your barcode-scanning feature more reliable.
1 thought on “Barcode Scanner Plugin Cordova – Best Options, Installation, and Code Examples!”