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
Country-specific screens
To ensure compliance with specific country requirements, document screens are customised for certain countries.
Below is a table summarising the information required for each country:
Country-Specific screens
OCR Prefill information
Extracts addresses from documents for better organization.
Ensures extracted information is valid before submission.
Allows users to manually input details if the OCR extraction is inaccurate or incomplete.
Display Manual Fields:
Open the OCR Review Screen
The OCR Review Screen will display the extracted address and manual fields for correction.
The manual address fields always appear on the OCR Review screen regardless of whether the extracted address matches a Google Place.
If a match is found, the address is automatically divided into the appropriate fields. If no match is found, the full address appears in the street name field.
Users must review the address and correct any validation errors as needed.
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.