Electronic Signature Module

The Electronic Signature module handles eIDAS-aligned electronic signing flows: render documents to be signed, collect compliance consents, capture the

📘

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 Electronic Signature module handles eIDAS-aligned electronic signing flows: render documents to be signed, collect compliance consents, capture the signature, and finalize. Three variants exist — base AES, Advanced Electronic Signature (AE), and Qualified Electronic Signature (QE) — that share a single state machine and manager API.

Follows the document-signing pattern. See the patterns page for the shared lifecycle.

Variants

ae-signature and qe-signature are thin wrappers around electronic-signature:

ModuleManager factoryConsent keys
@incodetech/core/electronic-signaturecreateElectronicSignatureManagerCaller-provided
@incodetech/core/ae-signaturecreateAeSignatureManagerAE_CONSENT_KEYS (3 keys)
@incodetech/core/qe-signaturecreateQeSignatureManagerQE_CONSENT_KEYS (5 keys)

The wrappers hardcode variant: 'ae' or 'qe' and re-export the same state machine, state types, and helpers from the base module (AeSignatureState is ElectronicSignatureState, etc.).

Web components: <incode-electronic-signature>, <incode-ae-signature>, <incode-qe-signature>. All three import paths register their own tag and ship their own CSS.

// Base AES
import '@incodetech/web/electronic-signature';
import '@incodetech/web/electronic-signature/styles.css';

// Advanced Electronic Signature
import '@incodetech/web/ae-signature';
import '@incodetech/web/ae-signature/styles.css';

// Qualified Electronic Signature
import '@incodetech/web/qe-signature';
import '@incodetech/web/qe-signature/styles.css';

Properties

PropertyTypeRequiredDescription
configElectronicSignatureConfigConfiguration options
onFinish() => voidCalled when signing completes
onError(error: string) => voidCalled when the user dismisses (closed)

Configuration

type ElectronicSignatureConfig = {
  variant?: 'ae' | 'qe'; // Hardcoded by the AE/QE wrapper modules
  uploadDocument?: boolean;
  downloadDocument?: boolean;
};
OptionTypeRequiredDescription
variant'ae' | 'qe'Set automatically by the AE/QE wrapper modules. Omit for base AES.
uploadDocumentbooleanAllow the user to upload a custom document to be signed.
downloadDocumentbooleanAllow the user to download the signed document afterwards.

Consent keys

The user must check all required consent boxes before signing. Each variant defines its own keys (re-exported from the variant's module):

const AE_CONSENT_KEYS = [
  'terms',
  'signElectronically',
  'signDisplayed',
] as const;

const QE_CONSENT_KEYS = [
  'issuance',
  'qesAcknowledgement',
  'qscdConfirmation',
  'termsAgreement',
  'documentsReviewed',
] as const;

Helpers from @incodetech/core/electronic-signature (also re-exported from the AE/QE wrappers): getDefaultConsentChecks(variant) returns a fresh ConsentChecks map for the given variant ('ae' | 'qe'); areAllConsented(consents) returns whether every key in that map is checked.

State machine

ElectronicSignatureState is a discriminated union over status:

StatusDescription
loadingFetching the documents to be signed.
uploadingUser selects a document to upload (when uploadDocument is set).
reviewingDocument preview before upload confirmation.
signingDocuments shown; user toggles consent checkboxes.
processingServer-side signing in progress.
successSigning accepted (auto-finishes after 3s unless download flow).
signErrorSigning failed; error screen shown for 3s then auto-finishes.
finishedTerminal success.
closedUser dismissed.
errorRecoverable upload/fetch-docs failure (Try Again).

The state.documents array (when populated) carries the ElectronicSignatureDocument[] to render: { documentRef, documentUrl }.

A few states carry additional fields beyond documents: uploading and reviewing add fileName (reviewing also adds fileUrl); signing adds variant, consentChecks, allConsented, and viewingDocumentUrl (set while viewDocument() is open); success adds signedDocuments: { signed: boolean; signedDocumentUrl?: string }[] and downloadDocument. The base AES endpoint returns a signedDocumentUrl per document; the QES endpoint acknowledges with { success: true } and no document URL, so signedDocumentUrl is absent for QE signatures — check signed rather than assuming a URL is always present.

API methods

MethodPurpose
load()Fetch documents.
setConsent(name, checked)Toggle a consent checkbox by key.
selectFile(fileName, fileData, fileUrl)Provide a custom document (when uploadDocument is true).
replaceFile()Clear the previously selected file.
confirmFile()Confirm document selection and proceed to signing.
viewDocument(url) / closeDocumentView()Open / close the document preview.
sign()Produce the signature once consents are checked.
finish()Acknowledge success and finish.
retry()After error, restart.
close()Dismiss (transitions to closed).

Plus the base lifecycle: subscribe, getState, stop. Unlike the face-capture and ID-capture managers, this manager has no reset() — create a new manager instance to start over.

See also


Did this page help you?