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 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). All three share a single state machine and manager API.
This module follows the document-signing pattern.
Variants
ae-signature and qe-signature are thin wrappers around electronic-signature:
| Module | Manager factory | Consent keys |
|---|---|---|
@incodetech/core/electronic-signature |
createElectronicSignatureManager |
Caller-provided |
@incodetech/core/ae-signature |
createAeSignatureManager |
AE_CONSENT_KEYS (3 keys) |
@incodetech/core/qe-signature |
createQeSignatureManager |
QE_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
| Property | Type | Required | Description |
|---|---|---|---|
config |
ElectronicSignatureConfig |
❌ | Configuration options |
onFinish |
() => void |
❌ | Called when signing completes |
onError |
(error: string) => void |
❌ | Called when the user dismisses (closed) |
Configuration
type ElectronicSignatureConfig = {
variant?: 'ae' | 'qe'; // Hardcoded by the AE/QE wrapper modules
uploadDocument?: boolean;
downloadDocument?: boolean;
providerCode?: string;
language?: string;
};
| Option | Type | Required | Description |
|---|---|---|---|
variant |
'ae' | 'qe' |
❌ | Set automatically by the AE/QE wrapper modules. Omit for base AES. |
uploadDocument |
boolean |
❌ | Allow the user to upload a custom document to be signed. |
downloadDocument |
boolean |
❌ | Allow the user to download the signed document afterwards. |
providerCode |
string |
❌ | QES_3 enables the Namirial QES terms flow. Other values preserve the existing QE consent flow. |
language |
string |
❌ | Locale used to request Namirial terms. en, it, and de are supported; other values use English. |
When the QE Signature module runs inside an SDK Flow, providerCode comes from the flow configuration and language comes from the active SDK locale. Set them directly only when creating a standalone manager.
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;
const NAMIRIAL_QES_CONSENT_KEYS = ['providerTerm0', 'providerTerm1'] 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.
For providerCode: 'QES_3', the SDK requests the certificate application and checkbox labels from the provider before loading documents. It renders exactly the two provider labels without adding SDK policy links. The user can open the provider's certificate application form in a plain-text viewer and must accept both statements before signing.
State machine
ElectronicSignatureState is a discriminated union over status:
| Status | Description |
|---|---|
loading |
Fetching the documents to be signed. |
uploading |
User selects a document to upload (when uploadDocument is set). |
reviewing |
Document preview before upload confirmation. |
signing |
Documents shown; user toggles consent checkboxes. |
processing |
Server-side signing in progress. |
success |
Signing accepted (auto-finishes after 3s unless download flow). |
signError |
Signing failed; error screen shown for 3s then auto-finishes. |
finished |
Terminal success. |
closed |
User dismissed. |
error |
Recoverable 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, providerTerms, viewingDocumentUrl, and viewingApplicationForm; success adds signedDocuments: { signed: boolean; signedDocumentUrl?: string }[] and downloadDocument. The base AES endpoint returns a signed URL immediately. Legacy QES returns only { success: true }; Namirial QES fetches the signed document collection after all documents are signed.
providerTerms.contractText can contain personal holder information. Treat it as ephemeral UI state: do not log, persist, or emit it as telemetry.
Error feedback
After narrowing state.status to error and signError, read state.errorMessage (string) for failure feedback. It can be empty, so provide a translated fallback. This field is only present in those error states; use the recovery actions below.
API methods
| Method | Purpose |
|---|---|
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. |
viewApplicationForm() / closeApplicationForm() |
Open / close the Namirial certificate application form. |
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
- Module: Signature: handwritten signature on canvas (no document review)
- Module Patterns → document-signing
- Individual Modules