Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
react-scan-qr-code
Advanced tools
You need a scanner component for Scanning QR codes from a web browser based app.
This component has been tested in the following browsers:
Since this library does internal use of hooks you need React >= 16.8.0
.
You can install this library via NPM or YARN.
npm i react-scan-qr-code
yarn add react-scan-qr-code
After reading and performing the previous steps, you should be able to import the library and use it like in this example:
import React, { useState } from 'react';
import { QrScanner } from 'react-scan-qr-code';
const Test = (props) => {
const [data, setData] = useState('No result');
return (
<>
<QrScanner
onSuccess={(result, error) => {
if (!!result) {
setData(result);
}
if (!!error) {
console.info(error.message);
}
}}
style={{ width: '100%' }}
/>
<p>{data}</p>
</>
);
};
The QrCodeScanner
component has the following props:
Properties | Types | Default Value | Description |
---|---|---|---|
constraints | MediaTrackConstraints | { facingMode: 'user' } | Specify which camera should be used (if available). |
onSuccess | function | none | Scan event handler |
videoId | string | video | The ID for the video element |
scanDelay | number | 500 | The scan period for the QR hook |
ViewFinder | component | none | ViewFinder component to rendering over the video element |
className | string | none | ClassName for the container element. |
containerStyle | object | none | Style object for the container element. |
videoContainerStyle | object | none | Style object for the video container element. |
videoStyle | object | none | Style object for the video element. |
Distributed under the MIT license. See LICENSE for more information.
FAQs
A React Component for scanning QR codes from the webcam
We found that react-scan-qr-code 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.