Skip to main content

Overview

The Form module consists of 13 screens that guide users through the verification flow. Each screen emits events following a consistent naming pattern.

Event Naming Convention

All screen events follow the pattern:
form:{screen_id}:{stage}
For example: form:welcome:ready, form:review:success, form:result:pending

Event Stages

StageDescriptionEmitted By
readyScreen is ready to be displayedAll screens
loadedScreen has been rendered and is interactiveAll screens
failedScreen failed to load or an error occurredAll screens
successAction completed successfullyreview, result, doc_upload
partialPartial verification resultreview, result
pendingVerification pending reviewreview, result
backUser navigated back from screendocument
navigateUser navigated to another screendocument, doc_upload

Event Payload

All screen events emit an EventPayload object:
{
  componentName?: string;     // Module name
  provider?: string;          // Provider name ('react')
  inputInfo: {
    name?: string;            // Screen ID (e.g., 'welcome', 'review')
    type?: string;            // Config type ('ocr', 'manual', 'doc_upload')
    documentType?: string;    // Document type if applicable
    index?: number;           // Document index if applicable
  }
}

Screen Reference

All examples below assume the SDK has been initialized:
const sdk = await OneSdk({
  session: { token: 'your-token' },
  recipe: {
    form: {
      provider: {
        name: 'react',
        googleApiKey: 'your-google-api-key'
      }
    }
  }
});

Welcome

The first screen shown to users. Introduces the verification process and provides a call-to-action to begin. Screen ID: welcome Events:
EventDescription
form:welcome:readyWelcome screen is ready to display
form:welcome:loadedWelcome screen has been rendered
form:welcome:failedWelcome screen failed to load
Example:
const welcome = sdk.component('form', {
  name: 'WELCOME',
  type: 'manual'
});

welcome.on('form:welcome:loaded', (payload) => {
  console.log('Welcome screen shown');
});

await welcome.mount('#form-container');

Start

Entry point screen for certain flows. Allows configuration of the initial verification step. Screen ID: start Events:
EventDescription
form:start:readyStart screen is ready to display
form:start:loadedStart screen has been rendered
form:start:failedStart screen failed to load

Collects user consent for identity verification and data processing. Screen ID: consent Events:
EventDescription
form:consent:readyConsent screen is ready to display
form:consent:loadedConsent screen has been rendered
form:consent:failedConsent screen failed to load
Example:
const consent = sdk.component('form', {
  name: 'CONSENT',
  type: 'manual'
});

consent.on('form:consent:loaded', (payload) => {
  console.log('Consent screen displayed');
});

await consent.mount('#form-container');

Document Selection

Allows users to select which identity document(s) they want to use for verification (e.g., driver’s licence, passport, national ID, Medicare card). Used in manual and doc_upload flows.
In OCR mode, the Document Selection screen is a legacy feature tied to headless OCR flows. Modern integrations use the IDV flow for document capture and the form Review screen to display extracted data.
Screen ID: document Supported Document Types:
  • DRIVERS_LICENCE - Driver’s licence
  • PASSPORT - Passport
  • NATIONAL_ID - National identity card
  • NATIONAL_HEALTH_ID - National health ID / Medicare card
Events:
EventDescription
form:document:readyDocument selection screen is ready
form:document:loadedDocument selection screen has been rendered
form:document:failedDocument selection screen failed to load
form:document:backUser navigated back from filling document detail to document selection
form:document:navigateUser selected a document and is navigating forward
Example:
const document = sdk.component('form', {
  name: 'DOCUMENT',
  type: 'manual',
  numberOfIDs: 2
});

document.on('form:document:loaded', (payload) => {
  console.log('Document selection screen displayed');
});

document.on('form:document:navigate', (payload) => {
  console.log('User selected:', payload.inputInfo.documentType);
});

await document.mount('#form-container');

Personal Details

Collects personal information such as name, date of birth, and address. Screen ID: personal Events:
EventDescription
form:personal:readyPersonal details screen is ready
form:personal:loadedPersonal details screen has been rendered
form:personal:failedPersonal details screen failed to load
Example:
const personal = sdk.component('form', {
  name: 'PERSONAL',
  type: 'manual'
});

personal.on('form:personal:loaded', (payload) => {
  console.log('Personal details form displayed');
});

await personal.mount('#form-container');

Review

Displays collected data for user review before submission. After review, submits the data for verification. Emits result-stage events based on verification outcome. Screen ID: review Events:
EventDescription
form:review:readyReview screen is ready to display
form:review:loadedReview screen has been rendered
form:review:failedEntity doesn’t pass verification
form:review:successVerification completed successfully
form:review:partialPartial match - some data verified, some needs attention
form:review:pendingVerification submitted but result is pending
Example:
const review = sdk.component('form', {
  name: 'REVIEW',
  type: 'manual',
  verify: true
});

review.on('form:review:loaded', (payload) => {
  console.log('Review screen displayed');
});

review.on('form:review:success', (payload) => {
  console.log('Verification passed');
});

review.on('form:review:partial', (payload) => {
  console.log('Partial match - additional info may be needed');
});

review.on('form:review:pending', (payload) => {
  console.log('Verification is pending review');
});

await review.mount('#form-container');

Loading

Displayed while verification is being processed. Screen ID: loading This screen is managed internally by the form module and typically does not require event handling.

Result

Displays the final verification result to the user. Shows success, failure, partial match, or pending status. Screen ID: result Result States:
StateDescription
SUCCESSVerification passed
FAILVerification failed
PENDINGVerification pending manual review
PARTIALPartial match - some checks passed
UPLOAD_SUCCESSDocument upload completed
UPLOAD_FAILDocument upload failed
PROVIDER_ERRORProvider encountered an error
Events:
EventDescription
form:result:readyResult screen is ready to display
form:result:loadedResult screen has been rendered
form:result:failedResult screen failed to load
form:result:successVerification completed successfully
form:result:partialPartial verification result
form:result:pendingVerification pending review
Example:
const resultSuccess = sdk.component('form', {
  name: 'RESULT',
  type: 'manual',
  state: 'SUCCESS',
  title: { label: 'Complete' },
  descriptions: [{ label: 'Process is now complete.' }],
  cta: { label: 'Done' }
});

resultSuccess.on('form:result:success', (payload) => {
  console.log('Verification passed!');
});

await resultSuccess.mount('#form-container');

Retry

Shown when verification returns a partial result and the user can retry. Allows re-entry of data that failed verification and intelligently adapts the retry flow based on the type of failure. Screen ID: retry Events:
EventDescription
form:retry:loadedRetry screen mounted
form:retry:readyUser completed the retry form
form:retry:failedRetry screen failed to load
Example:
const retry = sdk.component('form', {
  name: 'RETRY',
  type: 'manual'
});

retry.on('form:retry:loaded', (payload) => {
  console.log('Retry screen displayed - user can correct data');
});

await retry.mount('#form-container');

Smart Retry Behavior

The Retry screen intelligently adapts based on the type of verification failure. When verification returns a partial match, the SDK analyzes the failure type and presents the appropriate retry flow.
Triggered when: Verification returns a partial alert on personal details (e.g., address could not be confirmed against records).What happens: The Retry screen displays the personal details form with an additional toggle asking “Have you been at your current residential address for less than 6 months?” When the user enables this toggle, a previous address field appears prompting them to enter their prior residential address.Purpose: Helps resolve address verification failures by providing additional residential history that the verification provider can use to confirm the user’s identity.
Triggered when: Primary ID verification fails with a 404 alert (e.g., the submitted document could not be verified against records).What happens: The Retry screen displays additional document types that have not been submitted yet, prompting the user to select and fill in an alternative form of ID. Documents already submitted are filtered out from the selection list.Purpose: Provides a fallback path when the initial document cannot be verified, allowing the user to supply a different identity document for verification.
Retry Flow:
  1. Initial verification is submitted from the Review screen
  2. Verification returns a partial result (via partial or 404 alert)
  3. The SDK determines the failure type: personal details failure (VERIFICATION_FAILED_IDS.NAME) or document failure (VERIFICATION_FAILED_IDS.ID)
  4. The Retry screen presents the appropriate fields based on the failure type
  5. The user provides additional information (previous address or alternative ID)
  6. The flow transitions to the Review screen for re-submission
Example with retry limit:
const retry = sdk.component('form', {
  name: 'RETRY',
  type: 'manual'
});

const resultFail = sdk.component('form', {
  name: 'RESULT',
  type: 'manual',
  state: 'FAIL',
  title: { label: 'Max attempts reached' },
  descriptions: [
    { label: 'You have reached the maximum number of attempts.' }
  ],
  cta: { label: 'Close' }
});

let retryCount = 0;

review.on('form:result:partial', async () => {
  if (retryCount < 2) {
    retry.mount('#form-container');
    retryCount += 1;
  } else {
    resultFail.mount('#form-container');
  }
});

retry.on('form:retry:loaded', (payload) => {
  console.log('Retry screen displayed - attempt', retryCount);
});

Document Upload

Main document upload screen for uploading supporting documents. Screen ID: doc_upload Events:
EventDescription
form:doc_upload:readyUpload screen is ready
form:doc_upload:loadedUpload screen has been rendered
form:doc_upload:successDocument uploaded successfully
form:doc_upload:failedDocument upload failed
form:doc_upload:navigateUser navigated from upload screen
Example:
const docUpload = sdk.component('form', {
  name: 'DOC_UPLOAD',
  type: 'doc_upload'
});

docUpload.on('form:doc_upload:success', (payload) => {
  console.log('Document uploaded successfully');
});

docUpload.on('form:doc_upload:failed', (payload) => {
  console.log('Upload failed');
});

await docUpload.mount('#form-container');

Required Document Upload

Displays documents that are required for verification and must be uploaded. Screen ID: required_document_upload Events:
EventDescription
form:required_document_upload:readyRequired upload screen is ready
form:required_document_upload:loadedRequired upload screen has been rendered
form:required_document_upload:failedRequired upload screen failed to load

Partial Document Upload

Displays a list of documents where a minimum number must be uploaded (e.g., “upload at least 2 of these 4 documents”). Screen ID: partial_document_upload Events:
EventDescription
form:partial_document_upload:readyPartial upload screen is ready
form:partial_document_upload:loadedPartial upload screen has been rendered
form:partial_document_upload:failedPartial upload screen failed to load

Optional Document Upload

Displays optional documents that users can upload to strengthen their verification. Screen ID: optional_document_upload Events:
EventDescription
form:optional_document_upload:readyOptional upload screen is ready
form:optional_document_upload:loadedOptional upload screen has been rendered
form:optional_document_upload:failedOptional upload screen failed to load

Typical Screen Flow

OCR Flow (with IDV)

[IDV Capture] → Review (type: 'ocr') → Result
The IDV flow handles document capture. The form module provides the Review screen to display extracted data for user confirmation.

Manual Flow

Welcome → Consent → Personal Details → Document Selection → Review → Loading → Result → [Retry if failed]

Document Upload Flow

Welcome → Consent → Required Uploads → Partial Uploads → Optional Uploads → Review → Result

Screen-Level Event Listening Example

const sdk = await OneSdk({
  session: { token: 'your-token' },
  recipe: {
    form: {
      provider: {
        name: 'react',
        googleApiKey: 'your-google-api-key'
      }
    }
  }
});

const formComponent = sdk.component('form', {
  name: 'WELCOME',
  mode: 'individual',
  type: 'manual'
});

// Track every screen transition
const screens = [
  'welcome', 'start', 'consent', 'document',
  'personal', 'review', 'loading', 'result', 'retry',
  'doc_upload', 'required_document_upload',
  'partial_document_upload', 'optional_document_upload'
];

screens.forEach(screen => {
  formComponent.on(`form:${screen}:ready`, (payload) => {
    console.log(`[${screen}] ready`);
  });

  formComponent.on(`form:${screen}:loaded`, (payload) => {
    console.log(`[${screen}] loaded`);
  });

  formComponent.on(`form:${screen}:failed`, (payload) => {
    console.error(`[${screen}] failed`);
  });
});

// Handle verification outcomes
formComponent.on('form:review:success', () => {
  console.log('Verification passed at review stage');
});

formComponent.on('form:result:success', () => {
  console.log('Final result: success');
});

formComponent.on('form:result:partial', () => {
  console.log('Final result: partial match');
});

formComponent.on('form:result:pending', () => {
  console.log('Final result: pending');
});

await formComponent.mount('#form-container');