Identity Reuse Module

The Identity Reuse module recognizes a returning user by matching their selfie against existing on-file biometric records, then offering them the choice to

📘

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 Identity Reuse module offers a returning user the identity documents they already verified with partner organizations, so they can reuse one instead of capturing a fresh ID and selfie.

Follows the form-based pattern with a selection state. The user picks a document and submits their choice. See the patterns page for the shared lifecycle.

Tag

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

import '@incodetech/web/identity-reuse';
import '@incodetech/web/identity-reuse/styles.css';

Properties

PropertyTypeRequiredDescription
configIdentityReuseConfigNo options
onFinish() => voidCalled when the user's choice is submitted
onError(error: string) => voidCalled when an error occurs

Configuration

The module takes no configuration:

type IdentityReuseConfig = {};

Which prior documents are offered is configured server-side.

State machine

IdentityReuseState is a discriminated union over status. The selection state (documentsFound) is unique to this module:

StatusDescription
idleInitial state, waiting for load().
loadingFetching reusable documents from the backend.
documentsFoundDocuments are available; the user picks one and confirms.
submittingSubmitting the chosen document for reuse.
finishedTerminal.
errorRecoverable error; the user can retry or skip. Carries error.

When status === 'documentsFound':

PropertyTypeDescription
documentsReusableDocument[]Ordered documents; index 0 is the best match. Render the first entry as recommended — position is the only signal.
selectedDocumentIdSelectedDocumentId | undefinedThe current selection, or 'scanNew' when the user chose to scan a new document. Populated with documents[0].id on entry.

Each ReusableDocument carries id, documentType (camelCase, for example driversLicense), maskedNumber (for example 00*****29), countryCode (ISO 3166-1 alpha-3), and verifiedAt (Unix epoch in seconds). Format countryCode and verifiedAt in your own UI — the module passes both through unchanged.

API methods

MethodPurpose
load()Fetch reusable documents. Moves idleloading.
chooseDocument(documentId)Select a document by id, or pass the SCAN_NEW_DOCUMENT sentinel ('scanNew') to skip reuse.
submit()Confirm the selection. Submits the chosen document, or finishes without submitting for 'scanNew'.
skip()Skip identity reuse entirely and finish the module.
retry()Reload documents after an error.

Plus the universal lifecycle: subscribe, getState, reset, stop.

SCAN_NEW_DOCUMENT, the SelectedDocumentId type, and ReusableDocument are exported from @incodetech/core/identity-reuse:

import {
  createIdentityReuseManager,
  SCAN_NEW_DOCUMENT,
} from '@incodetech/core/identity-reuse';

const manager = createIdentityReuseManager({ config: {} });

manager.subscribe((state) => {
  if (state.status === 'documentsFound') {
    // Reuse the recommended document.
    manager.chooseDocument(state.documents[0].id);
    manager.submit();
  }
});

manager.load();

See also


Did this page help you?