
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
barcode-detection
Advanced tools
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
Via CDN:
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-javascript-barcode@9.6.20/dist/dbr.js"></script>
<script type="text/javascript" src="https://unpkg.com/@zxing/browser@latest"></script>
<script src="https://cdn.jsdelivr.net/npm/barcode-detection@latest/dist/barcode-detector.umd.js"></script>
Via npm:
npm install barcode-detection
Then import the package:
import {default as BarcodeDetectorPolyfill} from "barcode-detection"
let barcodeDetector;
async function init() {
if ("BarcodeDetector" in window) {
alert('Barcode Detector supported!');
}else{
alert('Barcode Detector is not supported by this browser, using the Dynamsoft Barcode Reader polyfill.');
BarcodeDetectorPolyfill.engine = "DBR"; // options: DBR and ZXing.
//initialize the Dynamsoft Barcode Reader with a license
BarcodeDetectorPolyfill.setDBRLicense("DLS2eyJoYW5kc2hha2VDb2RlIjoiMjAwMDAxLTE2NDk4Mjk3OTI2MzUiLCJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSIsInNlc3Npb25QYXNzd29yZCI6IndTcGR6Vm05WDJrcEQ5YUoifQ==");
await BarcodeDetectorPolyfill.initDBR();
window.BarcodeDetector = BarcodeDetectorPolyfill;
}
barcodeDetector = new window.BarcodeDetector({ formats: ["qr_code"] });
}
async function decode(imgEl) {
//decode an image element
let barcodes = await barcodeDetector.detect(imgEl);
}
You can apply for a license of Dynamsoft Barcode Reader here.
Dynamsoft Barcode Reader:
ZXing:
FAQs
Polyfill for the Barcode Detection API based on Dynamsoft Barcode Reader or ZXing.
We found that barcode-detection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.