Installations
npm install vue-qrcode-reader
Developer Guide
Typescript
Yes
Module System
ESM
Min. Node Version
>=18.0.0
Node Version
18.20.5
NPM Version
10.8.2
Score
68
Supply Chain
98.4
Quality
89.4
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
TypeScript (55.6%)
Vue (42.3%)
Nix (1.35%)
JavaScript (0.74%)
Shell (0.02%)
Developer
Download Statistics
Total Downloads
4,059,404
Last Day
4,614
Last Week
21,976
Last Month
98,130
Last Year
1,121,040
GitHub Statistics
2,156 Stars
375 Commits
343 Forks
33 Watching
22 Branches
29 Contributors
Bundle Size
70.96 kB
Minified
22.38 kB
Minified + Gzipped
Package Meta Information
Latest Version
5.7.0
Package Id
vue-qrcode-reader@5.7.0
Unpacked Size
198.45 kB
Size
58.82 kB
File Count
15
NPM Version
10.8.2
Node Version
18.20.5
Publised On
27 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
4,059,404
Last day
-14.9%
4,614
Compared to previous day
Last week
-19%
21,976
Compared to previous week
Last month
1.6%
98,130
Compared to previous month
Last year
19.8%
1,121,040
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Dev Dependencies
21
A set of Vue.js components for detecting QR codes and various other barcode formats right in the browser:
- :movie_camera:
QrcodeStream
continuously scans frames from a camera stream. - :put_litter_in_its_place:
QrcodeDropZone
is an empty region where you can drag-and-drop images to be decoded. - :open_file_folder:
QrcodeCapture
is a classic file upload field, instantly scanning all files you select.
All components are responsive. Beyond that, close to zero styling. Make them fit your layout. Usage is simple and straight forward:
1<qrcode-stream @detect="onDetect"></qrcode-stream>
1methods: { 2 onDetect (detectedCodes) { 3 // ... 4 } 5}
Preview
Related Projects
Installation :package:
With NPM
Run
1npm install vue-qrcode-reader
You can import the components independantly
1import { QrcodeStream, QrcodeDropZone, QrcodeCapture } from 'vue-qrcode-reader' 2 3const MyComponent = { 4 // 5 components: { 6 QrcodeStream, 7 QrcodeDropZone, 8 QrcodeCapture 9 } 10 11 // ... 12}
or register all of them globally right away
1import Vue from 'vue' 2import VueQrcodeReader from 'vue-qrcode-reader' 3 4Vue.use(VueQrcodeReader)
Without NPM
Include the following JS file:
https://unpkg.com/vue-qrcode-reader/dist/vue-qrcode-reader.umd.js
Make sure to include it after Vue:
1<script src="./vue.js"></script> 2<script src="./vue-qrcode-reader.umd.js"></script>
All components are automatically registered globally. Use kebab-case to reference them in your templates:
1<qrcode-stream></qrcode-stream> 2<qrcode-drop-zone></qrcode-drop-zone> 3<qrcode-capture></qrcode-capture>
Troubleshooting :zap:
I don't see the camera when using QrcodeStream
.
- Check if it works on the demo page. Especially the Handle Errors demo,
since it renders error messages.
- The demo works but it doesn't work in my project: Listen for the
error
event to investigate errors. - The demo doesn't work: Carefully review the Browser Support section above. Maybe your device is just not supported.
- The demo works but it doesn't work in my project: Listen for the
I'm running a dev server on localhost. How to test on my mobile device without HTTPS?
- If your setup is Desktop Chrome + Android Chrome, use Remote Debugging which allows your Android device to access your local server as localhost.
- Otherwise use a reverse proxy like ngrok or serveo to temporarily make your local server publicly available with HTTPS.
- There are also loads of serverless/static hosting services that have HTTPS enabled by default and where you can deploy your web app for free (e.g. GitHub Pages, GitLab Pages, Google Firebase, Netlify, Heroku, ZEIT Now, ...)
Some of my QR codes are not being detected.
- Make sure, there is some white border around the QR code.
- Test your QR codes in the upstream packages:
barcode-detector
->zxing-wasm
->zxing-cpp
, and file detection issues in the highest-level repository where the problem first occurs.
1D barcodes are not being detected.
The default value for the formats
prop is "['qr_code']"
, which reflects the setting before the formats
prop was available.
You'll need to add other barcode formats to this prop to detect those types of barcodes.
Check out this demo.
How to make it work with Vue 2?
Support is dropped but you can downgrade to vue-qrcode-reader v3.* or lower.
I get a "Failed to fetch" error at runtime for some Wasm file.
That Wasm file implements the QR code detector. Unfortunately, it's not very convenient to bundle this file with the package. So by default we fetch it at runtime from a CDN. That's an issue for offline applications or applications that run in a network with strict CSP policy. For a workaround see: https://github.com/gruhn/vue-qrcode-reader/issues/354
torch
is not supported on my device, although it has a flashlight.
Support for torch
is inconsistent across devices, cameras and browsers and operating systems.
On some devices the rear camera supports torch
but the front camera doesn't,
even if the front camera actually has a flashlight.
Furthermore, torch
is not supported on iOS at all (last checked iOS 17.1).
Visit this page with your device.
The list of links represents all cameras installed on the device.
If you click, the camera should be loaded.
Below the camera view the JSON object of "capabilities" is printed.
If it doesn't contain the key/value pair "torch": true
then flashlight is not supported for that camera.
This JSON object provided as payload of the camera-on
event.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/main.yml:9
Reason
3 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 9/26 approved changesets -- score normalized to 3
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/gruhn/vue-qrcode-reader/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/gruhn/vue-qrcode-reader/main.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/gruhn/vue-qrcode-reader/main.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/gruhn/vue-qrcode-reader/stale.yml/master?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 26 are checked with a SAST tool
Reason
12 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-vg6x-rcgg-rjx6
- Warn: Project is vulnerable to: GHSA-g3ch-rx76-35fx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
Score
4
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to vue-qrcode-reader
vue-barcode-reader
Vue barcodes and QR codes scanner
qrcode-reader-vue3
A set of Vue.js components for detecting and decoding QR codes.
@dargmuesli/vue-qrcode-reader
A set of Vue.js components for detecting and decoding QR codes.
vue-qrcode-reader-polyfill
A set of Vue.js components for detecting and decoding QR codes.