
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
@ertan95/react-native-document-scanner
Advanced tools
Scan documents, automatic border detection, automatic crop. Enhanced iOS stability by moving image capture to a background thread.

@ertan95/react-native-document-scannerIdentical to @Andycapn/react-native-document-scanner, but with enhancements that move the iOS image capture process to a background thread for improved stability, and include a fix for blurry images on iPhone Pro models by choosing the correct lens for optimal clarity and performance.
Live document detection library. Returns either a URI of the captured image, allowing you to easily store it or use it as you wish!
Version >=2.0.3 is thinking to work with React Native >= 0.70
Use version
1.6.2if you are using React Native 0.59
Install the library using either yarn:
yarn add @ertan95/react-native-document-scanner`
or npm:
npm install @ertan95/react-native-document-scanner --save
Remember, this library uses your device's camera, it cannot run on a simulator and you must request camera permission by your own.
CocoaPods on iOS needs this extra step:
cd ios && pod install && cd ..
Change manifest header to avoid "Manifest merger error". After you add xmlns:tools="http://schemas.android.com/tools" should look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.<yourAppName>" xmlns:tools="http://schemas.android.com/tools">
Add tools:replace="android:allowBackup" in <application tag. It should look like this:
<application tools:replace="android:allowBackup" android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:allowBackup="false" android:theme="@style/AppTheme">
Add Camera permissions request:
<uses-permission android:name="android.permission.CAMERA" />
import React, { Component, useRef } from "react"
import { View, Image } from "react-native"
import DocumentScanner from "@ertan95/react-native-document-scanner"
function YourComponent(props) {
return (
<View>
<DocumentScanner
style={styles.scanner}
onPictureTaken={handleOnPictureTaken}
overlayColor="rgba(255,130,0, 0.7)"
enableTorch={false}
quality={0.5}
detectionCountBeforeCapture={5}
detectionRefreshRateInMS={50}
onDeviceSetup={(event) => {
// set camera resolution width, height in styles.scanner on start up to avoid scanner disortion
console.log('onDeviceSetup:', event.height, event.width);
}}
/>
</View>
)
}
Full example in example folder.
| Prop | Platform | Default | Type | Description |
|---|---|---|---|---|
| overlayColor | Both | none | string | Color of the detected rectangle : rgba recommended |
| detectionCountBeforeCapture | Both | 5 | integer | Number of correct rectangle to detect before capture |
| detectionRefreshRateInMS | iOS | 50 | integer | Time between two rectangle detection attempt |
| enableTorch | Both | false | bool | Allows to active or deactivate flash during document detection |
| useFrontCam | iOS | false | bool | Allows you to switch between front and back camera |
| brightness | iOS | 0 | float | Increase or decrease camera brightness. Normal as default. |
| saturation | iOS | 1 | float | Increase or decrease camera saturation. Set 0 for black & white |
| contrast | iOS | 1 | float | Increase or decrease camera contrast. Normal as default |
| quality | iOS | 0.8 | float | Image compression. Reduces both image size and quality |
| useBase64 | iOS | false | bool | If base64 representation should be passed instead of image uri's |
| saveInAppDocument | iOS | false | bool | If should save in app document in case of not using base 64 |
| captureMultiple | iOS | false | bool | Keeps the scanner on after a successful capture |
| saveOnDevice | Android | false | bool | Save the image in the device storage (Need storage permissions) |
const documentScannerElement = useRef(null)
<DocumentScanner ref={documentScannerElement} />
documentScannerElement.current.capture()
| Props | Params | Type | Description |
|---|---|---|---|
| onRectangleDetect | { stableCounter, lastDetectionType } | object | See below |
The returned object includes the following keys :
stableCounterNumber of correctly formated rectangle found (this number triggers capture once it goes above detectionCountBeforeCapture)
lastDetectionTypeEnum (0, 1 or 2) corresponding to the type of rectangle found
| Prop | Params | Type | Description |
|---|---|---|---|
| onPictureTaken | data | object | Returns the captured image in an object { croppedImage: ('URI or BASE64 string'), initialImage: 'URI or BASE64 string', rectangleCoordinates[only iOS]: 'object of coordinates' } |
If you want to use saveInAppDocument options, then don't forget to add those raws in .plist :
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
FAQs
Scan documents, automatic border detection, automatic crop. Enhanced iOS stability by moving image capture to a background thread.
We found that @ertan95/react-native-document-scanner 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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.