
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
use-simple-camera
Advanced tools
Production-ready React Hooks for Camera, Video Recording, QR/Barcode Scanning, Motion Detection, and Audio Analysis. Zero dependencies, fully typed, and easy to use.
Use Simple Camera is a production-ready, zero-dependency React hook library for comprehensive camera and media handling. It provides a robust set of hooks for video recording, local/remote storage, computer vision (barcodes, motion detection), and hardware controls (zoom, flash, pan, tilt).
MediaRecorder API.npm install @ketanip/use-simple-camera
# or
pnpm add @ketanip/use-simple-camera
# or
yarn add @ketanip/use-simple-camera
The useSimpleCamera hook is the entry point that composes most features, but you can use individual hooks as standalone primitives.
import { useSimpleCamera } from "@ketanip/use-simple-camera";
const App = () => {
const { stream, ref, error, startCamera, captureImage } = useSimpleCamera();
if (error) return <p>Error: {error.message}</p>;
return (
<div>
<video ref={ref} autoPlay muted playsInline />
<button onClick={() => captureImage()}>Take Photo</button>
</div>
);
};
useSimpleCameraThe main hook for managing camera lifecycle, permissions, and stream state.
| Property | Type | Description |
|---|---|---|
stream | MediaStream | null | The active camera stream. |
startCamera | (constraints?) => Promise | Manually starts the camera. |
stopCamera | () => void | Stops all tracks and releases camera. |
captureImage | (options?) => string | Captures a base64 image. |
error | CameraError | null | Typed error object if something fails. |
isCameraActive | boolean | True if stream is active. |
switchCamera | () => void | Toggles between front and back cameras. |
useRecorderHandles video and audio recording with support for separate streams and callbacks.
import { useRecorder } from "use-simple-camera";
const { startRecording, stopRecording, isRecording } = useRecorder(stream);
| Property | Type | Description |
|---|---|---|
startRecording | (options?) => void | Starts recording media. Options: mode, onComplete. |
stopRecording | () => void | Stops recording and triggers onComplete with blob. |
takeSnapshot | () => Promise<Blob> | Captures a high-res still photo. |
useStorageManage local persistence (IndexedDB) and remote uploads (S3/XHR).
import { useStorage } from "use-simple-camera";
const { saveToLocal, uploadToRemote } = useStorage();
| Property | Type | Description |
|---|---|---|
saveToLocal | (blob, name, opts) => Promise | Save blob to IndexedDB with optional retention. |
getFromLocal | (name) => Promise<Blob> | Retrieve blob from IndexedDB. |
uploadToRemote | (blob, opts) => Promise | Upload to signed URL. Options: headers, timeout, etc. |
useCameraControlsControl hardware features like Zoom, Flash, Pan, and Tilt.
import { useCameraControls } from "use-simple-camera";
const { zoom, setZoom, flash, setFlash, supports } = useCameraControls(stream);
useBarcodeScannerDetects QR codes and Barcodes in real-time.
const { barcodes, isScanning } = useBarcodeScanner(stream, { formats: ['qr_code'] });
useMotionDetectionDetects movement in the video feed using pixel differencing.
const { motionDetected } = useMotionDetection(stream, { threshold: 10 });
useAudioLevelMonitors real-time microphone volume.
const { volume } = useAudioLevel(stream); // 0-100
useOrientationTracks device screen orientation.
const { orientation, angle } = useOrientation(); // 'portrait' | 'landscape'
useMediaDevicesEnumerates available audio and video inputs.
const { videoDevices, audioDevices } = useMediaDevices();
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
FAQs
Production-ready React Hooks for Camera, Video Recording, QR/Barcode Scanning, Motion Detection, and Audio Analysis. Zero dependencies, fully typed, and easy to use.
The npm package use-simple-camera receives a total of 17 weekly downloads. As such, use-simple-camera popularity was classified as not popular.
We found that use-simple-camera demonstrated a healthy version release cadence and project activity because the last version was released less than 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.