OCR Module
The Optical Character Recognition (OCR) Module enables document scanning and text extraction in your application. It supports both headed (UI-based) and headless implementations.
Getting Started
Implementation Options
Headed Implementation
Headless Implementation
You may need to adjust your Content Security Policy (CSP) settings to allow the IDV module to function correctly. Refer to this page for more details.
OCR Events
ready
ready
os emitted when the OCR is successfully mounted.
To listen to this event, use:
detection_complete
The OCR component emits a detection_complete
event when it successfully detects a customer’s information. The component emits this event immediately before results
. To listen to this event, use:
results
The component is submitting the end-user data during this event. To listen to this event, use:
where the data types for the parameters are:
checkStatus
will consist of either COMPLETE or FAILED, where
- “COMPLETE”: The process and the check results are ready.
- ”FAILED”: The process completed but failed to validate the captured ID and face.
document
: the document object generated after the OCR extract
entityId
: FrankieOne’s internal reference for the individual
detection_failed
The component has run unsuccessfully. You can use custom loading spinners or additional styles to handle this event gracefully. To listen to this event, use:
input_required
input_required
will emit the entityId
and the current status of the process, such as:
- Waiting for Document upload
WAITING_DOC_UPLOAD
- Waiting for selfie upload
WAITING_SELFIE_UPLOAD
- Uploaded document has invalid type
AWAITING_DOCUMENT_UPLOAD_INVALID_TYPE
- The process is either incomplete or interrupted
INCOMPLETE
/INTERRUPTED
.
For Incode, a lack of camera access permissions triggers the INTERRUPTED
event.
error
On error, we throw all events from the vendor back to you. To listen to this event, use:
If you’re using Incode, the possible messages are: InternalServerError
, OSVersionNotSupported
, and browserNotSupported
Implementation Example
Best Practices
- Validate image quality before submission to reduce OCR failures
- Implement proper error handling for all status codes
- Consider device capabilities when choosing implementation type
- Test with various document types and lighting conditions
Remember to handle potential errors and provide appropriate feedback to users during the document capture process.