Overview
The Form module provides a complete pre-built eKYC form UI that guides users through the identity verification process. It handles the full flow from welcome screen through document selection, data entry, review, submission, and results - all with a single component. The form module supports three configuration types:- OCR - Document capture with automatic data extraction
- Manual - Manual data entry by the user
- Doc Upload - Document file upload for verification
Accessing the Module
The Form module is accessed through the SDK’s component factory using the React provider:Configuration
Module Options
Options are passed during module initialization:
The module options also accept page-level configuration overrides. See Configuration for all available customization options.
Recipe Configuration
The Form module requires provider configuration in your recipe. Form configuration (screens, type, styling) is set through module options when callingsdk.component('form', options), not in the recipe.
Recipe Options
Google Maps Address Autocomplete
Address autocomplete requires two APIs enabled on your Google Cloud API key:GCP setup steps
- Open Google Cloud Console → APIs & Services → Library.
- Search for and enable Geocoding API.
- Search for and enable Places API (New).
- Go to APIs & Services → Credentials and open your API key.
- Under API restrictions → Restrict key, add both Geocoding API and Places API (New) to the allowed list.
- Save.
Script tag
Load the Maps JavaScript API before initializing OneSdk:OneSDK recipe configuration
useGoogleAutoCompleteSuggestion requires @frankieone/one-sdk v1.8.2 or later. Run npm install @frankieone/one-sdk@latest to upgrade.Methods
mount()
Mounts the Form component to a DOM element.
Signature:
Returns:
Promise<WrapperContext> - Resolves when the form is mounted. The WrapperContext contains a cleanup() method.
Example:
unmount()
Unmounts the Form component from the DOM.
Signature:
provider
Read-only property indicating the current vendor.
Type: 'react'
Events
The Form module uses a structured event system with two levels:Global Events
These events apply to the form module as a whole:
Example:
Screen Events
Each screen emits events following the patternform:{screen}:{stage}. See Screens for the complete screen event reference.
Event Pattern:
Event Payload:
All screen events emit an
EventPayload:
Complete Example
Best Practices
-
Set up event listeners before mounting - Register all event handlers before calling
mount()to avoid missing early events likereadyandloaded. -
Handle all result screen CTA events - Listen for
form:result:success,form:result:partial,form:result:pending, andform:result:failedto detect when the user dismisses a result screen. If usingcustomResult: trueon the review component, also handle the correspondingform:review:*events. -
Use the
navigationevent for progress tracking - The globalnavigationevent fires on every screen change, making it ideal for progress bars, analytics, and conditional UI outside the form. -
Configure
typeto match your flow - Choose'ocr','manual', or'doc_upload'based on your integration. The type determines which screens are shown and how data is collected. See Configuration Types. - Customize screens via page config, not DOM manipulation - Use the page configuration and CSS class keys to customize appearance and content rather than manipulating the DOM directly.
Common Issues
Component not displaying
Ensure the mount element exists in the DOM before callingmount() and has sufficient size:
Google address autocomplete not working
Symptoms — one or both of these appear in the browser console:REQUEST_DENIED— the API key does not have the Geocoding API authorized. Both the old and new autocomplete paths call the Geocoding API after retrieving suggestions; without it, address search returns nothing.AutocompleteServicewarning —useGoogleAutoCompleteSuggestionis not set totrue. The deprecatedAutocompleteServiceis unavailable on keys created after March 1, 2025 and will eventually be removed for all customers.
- In Google Cloud Console, enable Geocoding API and Places API (New) on the key and add both to the key’s API restrictions allow-list. See Google Maps setup.
- Set
useGoogleAutoCompleteSuggestion: truein the recipe’sform.providerconfig. - Ensure
@frankieone/one-sdkis v1.8.2 or later — upgrade withnpm install @frankieone/one-sdk@latestif needed.
Form fields not matching expected document type
The fields shown on the Review and Personal Details screens depend on thetype option and the document type selected. Ensure your form field configuration and country-specific settings match the document types available in your flow.
Sub-Pages
Screens
All 13 form screens, their events, and behavior
Configuration
Page customization, CSS styling, document upload, and form fields