@finwave/ocrid-v2
is a powerful library for identity document verification and onboarding. It provides tools for capturing, processing, and analyzing ID documents with a customizable and event-driven interface.
- OCR Scanning: Capture and process identity documents efficiently.
- Event-Driven: React to various stages of the scanning and processing workflow.
- TypeScript Support: Fully typed for enhanced developer experience and IDE support.
Install the package via NPM:
npm install @finwave/ocrid-v2
Import the library in your project:
import { OcrId } from '@finwave/ocrid-v2';
Create an instance of the library:
const ocr = new OcrId({
key: 'YOUR_API_KEY',
env: 'ENVIRONMENT',
});
// Subscribe to specific events
ocr.events(EventType.RESULT).subscribe((result) => {
console.log("Processing result:", result);
});
ocr.events(EventType.ERROR).subscribe((error) => {
console.error("An error occurred:", error);
});
const videoElement = document.getElementById("videoContainer");
ocr.startStream(videoElement)
.then(() => {
console.log("OCR stream started");
})
.catch((err) => {
console.error("Failed to start OCR stream:", err);
});
ocr.close();
console.log("OCR stream closed");
new OcrId(options: OcrIdOptions);
-
options
(OcrIdOptions
): An object containing the following properties:-
key
(string
): Your API key. -
env
(string
): The environment to use. -
config
: (object
): Optional configuration for the OCR process. Copiar código
-
Use the events
method to subscribe to specific events emitted by the library:
CONNECTED
: Emitted when the connection to the backend is established.
RESULT
: Emitted when the document is successfully processed.
ERROR
: Emitted in case of an error during processing.
USER_FEEDBACK
: Emitted for feedback on user interactions.
CLOSED
: Emitted when the process is closed.
For assistance, or to request an API key, please contact us at:
📧 Email: soporte.onboarding@finwave.es