Overview
This flow extends the basic IDV flow by adding an OCR review screen after document capture. After the camera captures and processes the document, the extracted data is shown in a review form for the user to confirm or correct before verification is submitted. This is useful when you want users to verify OCR accuracy. Modules used:idv, form (WELCOME, CONSENT, REVIEW, LOADING, RESULT screens)
Instead of building from scratch, fork an existing flow from the public sample codes.
Flow Diagram
IDV Capture
Camera capture UI for document scanning. Document is automatically detected and captured.
This flow requires a Google Places API key (
googleApiKey) in the form provider configuration. The key powers the address autocomplete field in the review form. Without it, the address search will not work. Get a key from the Google Cloud Console with the Places API enabled.Full Implementation
- Vanilla HTML/JS
- React
Step-by-Step Breakdown
1. Initialize the SDK
Pass the session object toOneSDK(). Include the recipe.form.provider configuration with a googleApiKey since this flow uses form components for the WELCOME, CONSENT, REVIEW, LOADING, and RESULT screens. The Google Places API key is required for the address autocomplete field in the review form.
2. Configure Components
Create WELCOME and CONSENT form components to collect user consent before starting capture. Create the IDV flow and form components for the REVIEW, LOADING, and RESULT screens.3. Wire Up Events
Listen for events:form:welcome:readyon welcome — user completed the welcome screen, mount consentform:consent:readyon consent — user gave consent, mount the IDV flowloadingon IDV — show/hide loading screen while IDV component initializes (before capture)detection_completeon IDV — document capture finished, show extraction loading screenresultson IDV — extraction complete, mount the review screenform:review:readyon review — user confirmed data, submit verification
4. Handle Results
After the review form emitsform:review:ready, mount a loading screen, then call sdk.individual().submit({ verify: true }) and mount the result screen. The loading screen prevents a blank screen during the async submission. See Error Scenarios for details.
Loading Screens
Three loading screens cover the async gaps in this flow:Unmount clears the container. Calling
.unmount() on a component removes all content from the element it was mounted to — not just the component itself. If you mount a LOADING screen and the IDV flow to the same container, unmounting the loading screen will also destroy the IDV content. Always mount loading screens to a separate element when they need to overlay another component.#loading-overlay) that sits on top of the main container, so unmount() only clears the overlay without affecting the IDV content underneath:
detection_complete and unmount when results fires:
submit() completes. Mount it immediately in the form:review:ready handler before calling submit():
Review Screen Configuration
The review screen displays extracted OCR data for user confirmation:type: "ocr" so the review form knows to display OCR-extracted fields. See Form Screens for customization options.
Submitting After Review
When the user confirms the review, theform:review:ready event fires. Mount a loading screen first so the user is not left with a blank screen during submission:
Customization Reference
| Aspect | Reference |
|---|---|
| SDK initialization options | SDK Initialization |
| IDV flow configuration | IDV Module |
| Form screen configuration | Form Module |
| Screen names and types | Form Screens |
| Individual submission | Individual Module |
| Event names and payloads | Events |
| Error handling patterns | Error Scenarios |