Government Validation Module

The Government Validation module submits the user's identity data (typically post-ID-capture) to a government registry for verification. Multiple validation

📘

This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. We strongly recommend upgrading - contact your Incode Representative for upgrade information.

The Government Validation module submits the user's identity data (typically post-ID-capture) to a government registry for verification. Multiple validation types can run simultaneously (facial, data, address) and OTP confirmation may be required for some country/regulator combinations.

Follows a hybrid of the backend-process pattern and the form-based pattern — backend-driven processing with an optional OTP sub-loop. See the patterns page for the shared lifecycle.

Availability

This module is headless-only — there is no public <incode-government-validation> web component. Drive it with createGovernmentValidationManager from @incodetech/core/government-validation. Typically invoked from an orchestrated flow.

Configuration

type GovernmentValidationConfig = {
  validationCountries: string[];
  facialValidation: boolean;
  dataValidation: boolean;
  faceAndDataValidation: boolean;
  addressValidation: boolean;
  backgroundExecution: boolean;
  faceMatchOverrideDataScore: boolean;
  useCroppedIdFacePhoto: boolean;
  maxOtpAttempts?: number;
};
OptionTypeRequiredDescription
validationCountriesstring[]ISO country codes the backend should run against.
facialValidationbooleanRun facial validation (selfie ↔ government photo).
dataValidationbooleanRun data validation (name, DOB, etc.).
faceAndDataValidationbooleanCombined face + data check.
addressValidationbooleanRun address validation.
backgroundExecutionbooleanWhen true, run silently without UI; advance via onFinish.
faceMatchOverrideDataScorebooleanAdvanced: face-match score overrides data-score for the final decision.
useCroppedIdFacePhotobooleanUse the cropped ID face photo (vs. full ID image).
maxOtpAttemptsnumberMax OTP attempts when OTP is required. Default 3.

These fields come from the dashboard's flow configuration. Most callers pass them through unmodified from the orchestrator's state.config.

State machine

GovernmentValidationState is a discriminated union over status:

StatusDescription
idleInitial state.
loadingLoading configuration / starting validation.
processingBackend validation in progress.
awaitingOtpThe chosen validation requires the user to confirm an OTP.
verifyingOtpVerifying the submitted OTP.
unknownValidation completed with an inconclusive result.
finishedTerminal — validation accepted (or auto-skipped on a non-fatal failure).
errorFatal error.

See also