Signature Module

The Signature module captures a handwritten signature on a touch surface or mouse-driven canvas and uploads it to the backend.

📘

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 Signature module captures a handwritten signature on a touch surface or mouse-driven canvas and uploads it to the backend.

Follows a slim variant of the document-signing pattern — there's no document review or consent step, just capture-and-submit. See the patterns page for the shared lifecycle.

Tag

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

import '@incodetech/web/signature';
import '@incodetech/web/signature/styles.css';

Properties

PropertyTypeRequiredDescription
configSignatureConfigConfiguration options
onFinish() => voidCalled when the signature is submitted
onError(error: string) => voidCalled when an error occurs

Configuration

type SignatureConfig = {
  type?: string;
  title?: string;
  subTitle?: string;
  sendBase64?: boolean;
  canvasBackgroundColor?: string;
  penStrokeWidth?: number;
  penColor?: string;
  canvasBorderColor?: string;
};
OptionTypeRequiredDescription
typestringBackend-side signature type identifier.
titlestringOptional header title. Defaults to a translated "Draw your signature" copy.
subTitlestringOptional subtitle. Note the capital T (matches the backend field).
sendBase64booleanWhen true, upload as base64 JSON (Omni v2). When false (default), upload raw image/jpeg bytes.
canvasBackgroundColorstringCSS color or var(--token) for the drawing area background.
penStrokeWidthnumberMaximum stroke width in CSS pixels (passed through to signature_pad's maxWidth).
penColorstringInk color.
canvasBorderColorstringBorder color of the drawing surface.

State machine

SignatureState is a discriminated union over status:

StatusDescription
idleInitial state.
captureUser is drawing on the canvas.
submittingUploading the captured signature image.
successUpload accepted.
finishedTerminal.
errorFatal error.

API methods

MethodPurpose
load()Start the machine; transitions to capture.
setSignatureValid(isValid)Update validity (e.g., enabled when the canvas has at least one stroke).
submit(image)Submit the signature. image is a base64 string or Blob per sendBase64.

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

See also