SDK reference, Incode Web SDK 2 Reference / Web SDK 2 Individual Modules

Government Validation Module

Note

This guide is specific to Web SDK 2.0. If you are still using 1.x, you can find documentation here. Contact your Incode Representative for upgrade information and check if you are a candidate for this upgrade.

Full rollout to all clients still TBD.

The Government Validation module (also called INE Validation) 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). It runs as a backend-only step: the validation outcome (success, failure, or unavailable for the country) never blocks or alters the user-facing journey. The SDK shows a loader while the call resolves, then the flow advances — there is no result screen and no OTP sub-flow. Use backend verification results for decisions; reaching finished is not proof that the registry check passed.

The same module handles two flow variants that share one manager, state machine, and UI: GOVT_VALIDATION_PROVISIONING (the general government-registry check) and INE_VALIDATION (the Mexico INE check). Both variants are configured from the dashboard flow, so most callers pass the config through unmodified.

This module follows the backend-process pattern.

Tag

<incode-government-validation> is a standard Web Component. Importing the UI subpath registers the custom element; importing the CSS applies the module's styles.

import '@incodetech/web/government-validation';
import '@incodetech/web/government-validation/styles.css';

For headless (no pre-built UI) control, drive it with createGovernmentValidationManager from @incodetech/core/government-validation. This module is typically invoked from an orchestrated flow rather than mounted standalone.

import { createGovernmentValidationManager } from '@incodetech/core/government-validation';

const manager = createGovernmentValidationManager({
  config: { facialValidation: true, dataValidation: true },
});
manager.subscribe((state) => {
  if (state.status === 'finished') manager.stop();
});
manager.load();

Configuration

type GovernmentValidationConfig = {
  validationCountries?: string[];
  facialValidation: boolean;
  dataValidation: boolean;
  faceAndDataValidation?: boolean;
  addressValidation?: boolean;
  faceMatchOverrideDataScore?: boolean;
  useCroppedIdFacePhoto?: boolean;
};
Option Type Required Description
validationCountries string[] ❌ ISO country codes the backend should run against.
facialValidation boolean ✅ Run facial validation (selfie ↔ government photo).
dataValidation boolean ✅ Run data validation (name, DOB, etc.).
faceAndDataValidation boolean ❌ Combined face + data check.
addressValidation boolean ❌ Run address validation.
faceMatchOverrideDataScore boolean ❌ Advanced: face-match score overrides data-score for the final decision.
useCroppedIdFacePhoto boolean ❌ Use the cropped ID face photo (vs. full ID image).

These options are consumed server-side — the SDK passes them through from the dashboard flow configuration and does not branch on them.

Warning

Breaking change (in the 2.3.0 release): backgroundExecution has been removed from GovernmentValidationConfig. The module now always runs as a backend-only step (loader, then done, no result screen) regardless of this flag's former value, so keeping a dead, always-required boolean around was more confusing than useful. Remove it from any config you pass explicitly.

INE validation options

These options apply to the Mexican INE check. Set them on the module's dashboard configuration rather than in application code:

Option Type Required Description
alternativeFacialValidation boolean ❌ Use the alternative facial-validation route for INE.
fallbackEnabled boolean ❌ Allow the backend to fall back to another validation route when the primary one is unavailable.
scrapingMethod boolean ❌ Select the scraping-based INE validation route.
scrapingV2 boolean ❌ Select version 2 of the scraping route.
scrapingV3 boolean ❌ Select version 3 of the scraping route.
failUnsupportedId boolean ❌ Ask the backend to record unsupported documents as a validation failure. The frontend still advances when the request resolves.

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:

Status Description
idle Initial state, before load().
loading Backend validation call in progress.
finished Terminal — reached regardless of the validation outcome (success, failure, or unavailable for the country). Nothing is surfaced to the end user.

See also

Was this page helpful?