
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
react-native-face-detector-camera
Advanced tools
A React Native front camera face detector module using MLKit
react-native-face-detector-camera
is an Expo module that uses device's front camera and MLKit to detect faces in real-time and visualize the detected face on the screen.
If this package helped you please give it a ⭐ on GitHub.
This package was created to meet a private project's need. New features are unlikely to be added. Bug fixes will be prioritized for those impacting project stability.
Knowing this, you're free to use this package as it is.
yarn add react-native-face-detector-camera
You can configure react-native-face-detector-camera
using built-in config plugin. This plugin allows you to change camera permission message that cannot be set at runtime and require you to build a new binary to take effect.
Example:
{
"expo": {
...,
"plugins": [
["react-native-face-detector-camera",{
"cameraPermission": "Allow $(PRODUCT_NAME) to access your camera"
}]
]
}
}
import {
useEffect,
useRef
} from 'react'
import {
StyleSheet,
View
} from 'react-native'
import {
CameraView,
useCameraPermissions,
FaceDetectorMode,
FaceDetectorClassifications,
FaceDetectionResult
} from 'react-native-face-detector-camera'
function App() {
const [
status,
requestPermission
] = useCameraPermissions()
const camera = useRef<CameraView>( null )
useEffect( () => {
( async () => {
if ( status?.granted ) return
await requestPermission()
} )()
}, [ status ] )
function processFaceDetection( {
faces
}: FaceDetectionResult ) {
console.log( 'faces', faces )
if ( faces.length <= 0 ) return
const {
size,
origin
} = faces[ 0 ].bounds
// handle face position on screen
if(
// size.width|height >= ...
// size.width|height <= ...
// origin.x >= ...
// origin.x <= ...
// origin.y >= ...
// origin.y <= ...
) {
handleTakePicture()
}
}
function handleTakePicture() {
if ( !camera.current ) {
console.log( 'camera ref is not valid' )
return
}
camera.current.takePictureAsync( {
skipProcessing: true,
onPictureSaved: ( async ( {
uri
} ) => {
console.log( 'picture saved event', uri )
} )
} )
}
return (
<View
style={ StyleSheet.absoluteFill }
>
<CameraView
ref={ camera }
style={ StyleSheet.absoluteFill }
facing={ 'front' }
onCameraReady={ () => { console.log( 'camera is ready' ) } }
onMountError={ () => { console.log( 'camera mount error' ) } }
faceDetectorSettings={ {
mode: FaceDetectorMode.fast,
runClassifications: FaceDetectorClassifications.all,
minDetectionInterval: 200
} }
onFacesDetected={ processFaceDetection }
/>
</View>
)
}
Min Android/IOS versions:
Android SDK
: 26
(Android 8)IOS
: 13.4
Made with ❤️ by nonam4
FAQs
A React Native front camera face detector module using MLKit
The npm package react-native-face-detector-camera receives a total of 29 weekly downloads. As such, react-native-face-detector-camera popularity was classified as not popular.
We found that react-native-face-detector-camera 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.