Skip to main content

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 calling sdk.component('form', options), not in the recipe.

Recipe Options

Google Maps Address Autocomplete

Action required for all integrations using address search. Google’s Geocoding API now returns REQUEST_DENIED for keys that do not have it explicitly authorized. Address search will silently fail until the key is updated. Follow the steps below.
Address autocomplete requires two APIs enabled on your Google Cloud API key:

GCP setup steps

  1. Open Google Cloud Console → APIs & Services → Library.
  2. Search for and enable Geocoding API.
  3. Search for and enable Places API (New).
  4. Go to APIs & Services → Credentials and open your API key.
  5. Under API restrictions → Restrict key, add both Geocoding API and Places API (New) to the allowed list.
  6. 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:
Parameters: 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:
unmount() clears all content from the element the component was mounted to — not just the component itself. If another component (e.g., an IDV flow) is sharing the same container, unmounting will destroy its content too. When you need to show a loading screen alongside another component, mount the loading screen to a separate element so that unmounting it does not affect the other component. See the IDV with Review flow for an example.
Example:

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 pattern form:{screen}:{stage}. See Screens for the complete screen event reference. Event Pattern:
Event Stages:
form:review:* events require customResult: trueThe form:review:success, form:review:failed, form:review:partial, and form:review:pending events are only emitted when customResult: true is set in manual mode. When customResult is false (the default), the form automatically navigates to and displays the configured result screen without emitting these events.In OCR mode, the only terminal event is ready on the final screen.
Event Payload: All screen events emit an EventPayload:

Complete Example


Best Practices

  1. Set up event listeners before mounting - Register all event handlers before calling mount() to avoid missing early events like ready and loaded.
  2. Handle all result screen CTA events - Listen for form:result:success, form:result:partial, form:result:pending, and form:result:failed to detect when the user dismisses a result screen. If using customResult: true on the review component, also handle the corresponding form:review:* events.
  3. Use the navigation event for progress tracking - The global navigation event fires on every screen change, making it ideal for progress bars, analytics, and conditional UI outside the form.
  4. Configure type to 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.
  5. 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 calling mount() and has sufficient size:

Google address autocomplete not working

Symptoms — one or both of these appear in the browser console:
Root causes:
  • 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.
  • AutocompleteService warning — useGoogleAutoCompleteSuggestion is not set to true. The deprecated AutocompleteService is unavailable on keys created after March 1, 2025 and will eventually be removed for all customers.
Fix:
  1. 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.
  2. Set useGoogleAutoCompleteSuggestion: true in the recipe’s form.provider config.
  3. Ensure @frankieone/one-sdk is v1.8.2 or later — upgrade with npm install @frankieone/one-sdk@latest if needed.

Form fields not matching expected document type

The fields shown on the Review and Personal Details screens depend on the type 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