secure-kyc-capture
v1.0.6
Published
A production-ready React component for auto-detecting and auto-capturing Indian KYC documents (Aadhaar, PAN, Passport, Driving License, etc.) with real-time quality feedback and AI-powered sharpening.
Maintainers
Readme
Secure KYC Auto-Capture
A production-ready React component for auto-detecting and auto-capturing Indian KYC documents (Aadhaar, PAN, Passport, Driving License, etc.) with real-time quality feedback and AI-powered sharpening.
⚡ Fully Offline Solution – All processing happens locally in the browser.
🔐 More Secure by Design – No image data is sent to any server.
✨ Features
- Auto-Capture: Intelligent document detection and automatic capture.
- AI Sharpening: Post-capture sharpening for maximum text clarity.
- Quality Feedback: Real-time stats for Sharpness, Glare, and Document Size.
- Zero Data Transmission: No backend calls. No cloud uploads.
- Privacy First: Local processing using TensorFlow.js (COCO-SSD).
- Responsive: Works on Mobile (1080p ideal) and Desktop.
📦 Installation
npm install secure-kyc-capture🛠 Usage
import { CameraView } from 'secure-kyc-capture';
import 'secure-kyc-capture/dist/style.css'; // If you use the bundled styles
function App() {
const handleCapture = (data) => {
console.log('Captured Image:', data.image);
console.log('Document Type:', data.docType);
console.log('Confidence:', data.confidence);
};
return (
<div style={{ width: '100vw', height: '100vh' }}>
<CameraView onCapture={handleCapture} />
</div>
);
}🔌 Props
| Prop | Type | Description |
|------|------|-------------|
| onCapture | (data: CaptureData) => void | Callback triggered when a document is captured. |
🧠 CaptureData
{
image: string; // Base64 encoded JPEG
docType: string; // Detected class (e.g., 'document')
confidence: number; // AI confidence score
}🚀 Live Example Application
A complete working example demonstrating integration in a real React + TypeScript app:
🔗 Example App Repository:
https://github.com/PRATHAM-SPS/secure-kyc-capture
This example includes:
- Camera page
- Preview screen
- Retake flow
- Light/Dark mode
👨💻 Author
Built and maintained by Pratham Ingawale
GitHub: https://github.com/PRATHAM-SPS
License
MIT
