Document Upload Module

The Document Upload module is a file-picker-only upload path for documents — used when live camera capture isn't appropriate (e.g., a third ID document, or a

📘

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 Document Upload module is a file-picker-only upload path for documents — used when live camera capture isn't appropriate (e.g., a third ID document, or a document the user has stored as a PDF). Unlike Document Capture, it does not offer a camera mode.

Follows a slim variant of the camera-capture pattern — initialize → capture (file pick) → upload → finished. No tutorial, no permissions, no live ML detection. See the patterns page for the shared lifecycle.

Availability

This module is headless-only — there is no public <incode-document-upload> web component. Drive it with createDocumentUploadManager from @incodetech/core/document-upload and render your own file-picker UI.

Configuration

type DocumentUploadConfig = {
  documentType: string; // Required. Sent to the upload endpoint as a query parameter (e.g., 'thirdId').
};
OptionTypeRequiredDescription
documentTypestringDocument-type identifier the upload endpoint expects. Common value: 'thirdId'.

State machine

DocumentUploadState is a discriminated union over status:

StatusDescription
initializingSetting up; brief.
capturingWaiting for the user to pick a file.
uploadingFile picked; uploading to the backend with progress.
finishedTerminal — module complete.
closedUser dismissed.
errorFatal error. Inspect state.error for the error code.

Error codes (DOCUMENT_UPLOAD_ERROR_CODES):

  • DOCUMENT_UPLOAD_ERROR — upload itself failed
  • DOCUMENT_UPLOAD_CAMERA_ERROR — legacy code, kept for backward compatibility

API methods

MethodPurpose
start()Open the file picker (transitions from initializing).
capture(imageBase64)Provide the picked file's data.
retry()After error, retry the upload.
close()Dismiss (transitions to closed).

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

See also