FaceSign
Reference

Node Reference

Complete reference for all FaceSign verification node types — parameters, outcomes, and configuration.

This reference documents every FaceSign node type with its full parameter set, outcome keys, and configuration options.

Base node structure

All nodes share these fields:

FieldTypeRequiredDescription
idstringYesUnique identifier within the flow. You assign this.
typestringYesThe node type. Must be one of the values listed below.

Node type enum

enum FSNodeType {
  START = "start",
  END = "end",
  CONVERSATION = "conversation",
  LIVENESS_DETECTION = "liveness_detection",
  FACE_SCAN = "face_scan",
  DOCUMENT_SCAN = "document_scan",
  RECOGNITION = "recognition",
  ENTER_EMAIL = "enter_email",
  TWO_FACTOR_EMAIL = "two_factor_email",
  TWO_FACTOR_SMS = "two_factor_sms",
  DATA_VALIDATION = "data_validation",
  FACE_COMPARE = "face_compare",
  PERMISSIONS = "permissions"
}

START

Entry point for every flow. Exactly one START node is required per flow.

Additional fields:

FieldTypeRequiredDescription
outcomestringYesThe id of the next node to execute.

Example:

{
  "id": "start_node",
  "type": "start",
  "outcome": "welcome_conversation"
}

END

Exit point for a flow. At least one END node is required. The END node has no outcomes -- reaching it marks the session as complete.

Additional fields: None.

Example:

{
  "id": "end_node",
  "type": "end"
}

CONVERSATION

AI-powered conversational interaction. The avatar speaks the prompt and waits for the user to respond. FaceSign's AI evaluates the response against the defined conditions and selects the matching outcome.

Additional fields:

FieldTypeRequiredDescription
promptstringYesThe message the avatar speaks. Use Say: ... prefix for direct speech. Supports {name}, {email} template variables from session data.
outcomesarrayYesNon-empty array of conditional outcomes (see below).
doesNotRequireReplybooleanNoIf true, the node advances immediately without waiting for a user response. Useful for farewell messages before an END node.

Outcome structure (FSConditionalOutcome):

FieldTypeRequiredDescription
idstringYesUnique identifier for this outcome.
targetNodeIdstringYesThe id of the next node if this condition matches.
conditionstringYesNatural-language description of when this outcome applies. Evaluated by AI.

Example:

{
  "id": "ask_name",
  "type": "conversation",
  "prompt": "Say: Hi there, could you tell me your full name?",
  "outcomes": [
    {
      "id": "tr_has_name",
      "targetNodeId": "verify_email",
      "condition": "The user provided their name"
    },
    {
      "id": "tr_no_name",
      "targetNodeId": "ask_name_again",
      "condition": "The user did not provide their name"
    }
  ]
}

LIVENESS_DETECTION

Anti-spoofing check to confirm a real person is present. Detects photos, videos, and deepfakes.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).

Outcomes:

KeyDescription
livenessDetectedNode id to execute if a live person is confirmed.
deepfakeDetectedNode id to execute if a deepfake or replay is detected.
noFaceNode id to execute if no face is found in the frame.

Example:

{
  "id": "liveness_check",
  "type": "liveness_detection",
  "outcomes": {
    "livenessDetected": "proceed_to_document",
    "deepfakeDetected": "verification_failed",
    "noFace": "retry_liveness"
  }
}

FACE_SCAN

Captures the user's face and performs 1:1 matching against a reference image (e.g., from a scanned document or a provided photo).

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).
referenceImageKeystringNoKey in the session's providedData object containing the reference image.
similarityThresholdnumberNoMatch threshold from 0 to 1. Default: 0.85.
captureInstructionsstringNoCustom instruction text shown to the user during capture.
requireLivenessChallengebooleanNoWhether to require an active liveness challenge during capture.
requireAILivenessCheckbooleanNoWhether to run an AI-based liveness check on the captured image.
enableSoundbooleanNoEnable a capture sound effect.
enableHapticsbooleanNoEnable haptic feedback on supported devices.

Outcomes:

KeyDescription
passedNode id if the face matches the reference above the threshold.
notPassedNode id if the face does not match.
cancelledNode id if the user cancels or exits the capture.
errorNode id if a technical error occurs.

Example:

{
  "id": "face_matching",
  "type": "face_scan",
  "outcomes": {
    "passed": "verification_complete",
    "notPassed": "retry_or_review",
    "cancelled": "flow_cancelled",
    "error": "technical_error"
  },
  "referenceImageKey": "primary_doc_face",
  "similarityThreshold": 0.90,
  "captureInstructions": "Look straight into the camera",
  "requireLivenessChallenge": true
}

DOCUMENT_SCAN

Captures and verifies an identity document. Supports passports, driver's licenses, and national ID cards.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).
scanningModestringYes"single" scans one side only. "automatic" detects and scans all required sides based on document type.
allowedDocumentTypesarrayYesArray of allowed document types: "passport", "driver_license", "id_card".
showTorchButtonbooleanNoShow a flashlight toggle in the UI.
showCameraSwitchbooleanNoAllow the user to switch between front and rear cameras.
showMirrorCameraButtonbooleanNoAllow mirrored camera mode.

Outcomes:

KeyDescription
scanSuccessNode id on a successful document scan.
userCancelledNode id if the user cancels the scan.
scanTimeoutNode id if the scan times out.

Example:

{
  "id": "document_verification",
  "type": "document_scan",
  "scanningMode": "automatic",
  "allowedDocumentTypes": ["passport", "driver_license", "id_card"],
  "outcomes": {
    "scanSuccess": "face_matching",
    "userCancelled": "handle_cancellation",
    "scanTimeout": "retry_scan"
  },
  "showTorchButton": true
}

RECOGNITION

1:N face recognition. Checks whether the user's face matches any existing entry in your FaceSign database.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).

Outcomes:

KeyDescription
recognizedNode id if the user matches a known face in the database.
newUserNode id if no match is found (new user).
noFaceNode id if no face is detected.

Example:

{
  "id": "check_existing_user",
  "type": "recognition",
  "outcomes": {
    "recognized": "welcome_back",
    "newUser": "onboard_new_user",
    "noFace": "retry_capture"
  }
}

ENTER_EMAIL

Presents a form for the user to enter their email address.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).

Outcomes:

KeyDescription
emailEnteredNode id after the user submits their email.
canceledNode id if the user cancels.

Example:

{
  "id": "collect_email",
  "type": "enter_email",
  "outcomes": {
    "emailEntered": "send_otp",
    "canceled": "handle_cancel"
  }
}

TWO_FACTOR_EMAIL

Sends a one-time passcode (OTP) via email and verifies the user enters the correct code.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).
otpLengthnumberNoNumber of digits in the OTP. Default: 6.
expirySecondsnumberNoHow long the OTP remains valid, in seconds.
maxAttemptsnumberNoMaximum number of entry attempts allowed.
resendAfterSecondsnumberNoMinimum seconds before the user can request a new OTP.
showUIbooleanNoWhether to display the OTP entry UI. Default: true.
emailTemplatestringNoCustom email body template. Use {{otp}} as the placeholder.

Outcomes:

KeyDescription
verifiedNode id on successful OTP verification.
delivery_failedNode id if the email could not be delivered.
failed_unverifiedNode id if the user exhausts attempts or enters an invalid code.
cancelledNode id if the user cancels.
errorNode id on a general error.

Example:

{
  "id": "email_2fa",
  "type": "two_factor_email",
  "otpLength": 6,
  "expirySeconds": 300,
  "maxAttempts": 5,
  "resendAfterSeconds": 60,
  "outcomes": {
    "verified": "access_granted",
    "delivery_failed": "technical_support",
    "failed_unverified": "retry_email_2fa",
    "cancelled": "flow_cancelled",
    "error": "technical_error"
  }
}

TWO_FACTOR_SMS

Sends a one-time passcode (OTP) via SMS and verifies the user enters the correct code.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).
otpLengthnumberNoNumber of digits in the OTP. Default: 6.
expirySecondsnumberNoHow long the OTP remains valid, in seconds.
maxAttemptsnumberNoMaximum number of entry attempts allowed.
resendAfterSecondsnumberNoMinimum seconds before the user can request a new OTP.
showUIbooleanNoWhether to display the OTP entry UI. Default: true.
smsTemplatestringNoCustom SMS body template. Use {{otp}} as the placeholder.

Outcomes:

KeyDescription
verifiedNode id on successful OTP verification.
delivery_failedNode id if the SMS could not be delivered.
failed_unverifiedNode id if the user exhausts attempts or enters an invalid code.
cancelledNode id if the user cancels.
errorNode id on a general error.

Example:

{
  "id": "sms_2fa",
  "type": "two_factor_sms",
  "otpLength": 6,
  "expirySeconds": 300,
  "maxAttempts": 5,
  "resendAfterSeconds": 60,
  "outcomes": {
    "verified": "access_granted",
    "delivery_failed": "technical_support",
    "failed_unverified": "retry_sms_2fa",
    "cancelled": "flow_cancelled",
    "error": "technical_error"
  }
}

DATA_VALIDATION

Performs conditional routing based on collected session data. Evaluates a validation rule against a data field and routes through transitions.

Additional fields:

FieldTypeRequiredDescription
validationobjectYesThe validation rule to evaluate (see below).
transitionsarrayYesOrdered array of conditional transitions (see below).

Validation object:

FieldTypeRequiredDescription
fieldstringYesThe data field to validate (e.g., "age", "email").
actionstringYesThe validation operation: "exists", "matches", "contains", "greater_than", etc.
valuestringNoThe expected value for comparison.

Transition structure:

FieldTypeRequiredDescription
idstringYesUnique identifier for this transition.
targetNodeIdstringYesThe id of the next node if this condition matches.
conditionstringYesDescription of when this transition applies.

Example:

{
  "id": "validate_age",
  "type": "data_validation",
  "validation": {
    "field": "age",
    "action": "greater_than",
    "value": "18"
  },
  "transitions": [
    {
      "id": "adult",
      "targetNodeId": "full_verification",
      "condition": "age >= 18"
    },
    {
      "id": "minor",
      "targetNodeId": "parental_consent",
      "condition": "age < 18"
    }
  ]
}

FACE_COMPARE

Compares two face images captured during the session to determine whether they belong to the same person.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).

Outcomes:

KeyDescription
matchNode id if the two faces match.
noMatchNode id if the faces do not match.
errorNode id if a technical error occurs.

Example:

{
  "id": "compare_faces",
  "type": "face_compare",
  "outcomes": {
    "match": "verification_passed",
    "noMatch": "verification_failed",
    "error": "technical_error"
  }
}

PERMISSIONS

Requests camera and microphone access from the user's browser. Typically placed early in the flow before any node that requires media access.

Additional fields:

FieldTypeRequiredDescription
outcomesobjectYesFixed outcome map (see below).

Outcomes:

KeyDescription
grantedNode id if the user grants the requested permissions.
deniedNode id if the user denies permissions.

Example:

{
  "id": "request_permissions",
  "type": "permissions",
  "outcomes": {
    "granted": "start_verification",
    "denied": "permissions_required"
  }
}

Flow validation rules

FaceSign validates your flow at session creation time. Flows that violate any of these rules are rejected with an error:

RuleDescription
Exactly one STARTEvery flow must have exactly one node with type: "start".
At least one ENDEvery flow must have at least one node with type: "end".
No cyclesThe graph must be a directed acyclic graph (DAG). No node can be revisited.
Valid referencesEvery outcome must point to the id of an existing node in the flow.
Complete outcomesAll non-END nodes must define outcomes covering their required keys.

Next steps

On this page