@facesignai/api 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,3 +27,348 @@ const facesignClient = new Client({
27
27
  ```
28
28
 
29
29
  Make a request to any Facesign API endpoint.
30
+
31
+ ## Flow & Nodes
32
+
33
+ A flow is a directed graph of nodes that defines a session. Sessions can serve different purposes — identity verification, data collection, authorization, analysis, or any combination. Every flow must start with a **START** node and end with one or more **END** nodes. Nodes connect to each other via **outcomes** — each outcome points to the `id` of the next node. All defined outcomes must be connected to other nodes; no outcome can be left unlinked.
34
+
35
+ ### START Node
36
+
37
+ The entry point of every flow. Each flow must have exactly one START node. It has a single `outcome` that points to the first node in the flow.
38
+
39
+ ```typescript
40
+ {
41
+ id: "start",
42
+ type: "start",
43
+ outcome: "next-node-id"
44
+ }
45
+ ```
46
+
47
+ ### END Node
48
+
49
+ The terminal node of a flow. A flow can have multiple END nodes (e.g., one for success path, one for failure path). It has no outcomes.
50
+
51
+ ```typescript
52
+ {
53
+ id: "end-success",
54
+ type: "end"
55
+ }
56
+ ```
57
+
58
+ ### CONVERSATION Node
59
+
60
+ The avatar speaks to the user using the `prompt` text and routes the flow based on the user's response. The session stays on this node until one of the outcome conditions matches the user's response, so a single conversation node can facilitate a multi-turn dialog with the user until the desired information is gathered.
61
+
62
+ The `prompt` field supports two modes:
63
+
64
+ 1. **Direct speech** — Tell the avatar exactly what to say:
65
+ `"Say: Hi, how are you doing?"`
66
+
67
+ 2. **Goal-driven behavior** — Describe what the avatar should achieve during the conversation:
68
+ `"Chat with the user and find out how well they understand medicine."`
69
+
70
+ When using goal-driven prompts, always include realistic exit conditions in the outcomes, since the dialog could otherwise continue indefinitely. Examples of exit conditions:
71
+ - User didn't respond after 3 attempts
72
+ - The dialog has reached 6 exchanges and no condition was met
73
+ - User refuses to answer
74
+
75
+ Uses conditional outcomes — each outcome has a `condition` (a natural language description of what the user's response should match) and a `targetNodeId` pointing to the next node.
76
+
77
+ Set `doesNotRequireReply: true` for nodes at the end of the flow where the avatar delivers a final message and no user response is needed (e.g., "Thank you for the conversation, goodbye!"). Typically used before an END node.
78
+
79
+ **Outcomes** use `FSConditionalOutcome`:
80
+ - `id` — unique identifier for the outcome
81
+ - `targetNodeId` — the node to navigate to
82
+ - `condition` — natural language description of the matching criteria
83
+
84
+ **Direct speech example:**
85
+ ```typescript
86
+ {
87
+ id: "greeting",
88
+ type: "conversation",
89
+ prompt: "Say: Hello! What would you like to do today?",
90
+ outcomes: [
91
+ { id: "verify", targetNodeId: "liveness-node", condition: "User wants to verify their identity" },
92
+ { id: "info", targetNodeId: "info-node", condition: "User wants more information" }
93
+ ]
94
+ }
95
+ ```
96
+
97
+ **Goal-driven example:**
98
+ ```typescript
99
+ {
100
+ id: "medical-assessment",
101
+ type: "conversation",
102
+ prompt: "Chat with the user and assess their level of medical knowledge.",
103
+ outcomes: [
104
+ { id: "high", targetNodeId: "advanced-path", condition: "User demonstrates strong medical knowledge" },
105
+ { id: "low", targetNodeId: "basic-path", condition: "User has limited medical knowledge" },
106
+ { id: "no-response", targetNodeId: "end-fail", condition: "User didn't respond after 3 attempts" },
107
+ { id: "timeout", targetNodeId: "end-fail", condition: "Dialog reached 6 exchanges with no condition met" },
108
+ { id: "refused", targetNodeId: "end-fail", condition: "User refuses to answer" }
109
+ ]
110
+ }
111
+ ```
112
+
113
+ **End-of-flow example:**
114
+ ```typescript
115
+ {
116
+ id: "goodbye",
117
+ type: "conversation",
118
+ prompt: "Thank you for the conversation, goodbye!",
119
+ doesNotRequireReply: true,
120
+ outcomes: [
121
+ { id: "done", targetNodeId: "end", condition: "" }
122
+ ]
123
+ }
124
+ ```
125
+
126
+ ### PERMISSIONS Node
127
+
128
+ Requests camera and/or microphone permissions from the user before proceeding. Use this node when you need to display a custom prompt explaining why permissions are needed, or when you want to handle the denied case with a specific flow path.
129
+
130
+ If the flow does not contain any PERMISSIONS node, permissions will be requested automatically.
131
+
132
+ - `permissions.camera` — request camera access
133
+ - `permissions.microphone` — request microphone access
134
+ - `prompt` — optional message the avatar will say (uses direct speech mode, e.g., `"Say: Could you please enable your microphone so I can hear you."`). If the site already has permanent permissions granted, the avatar will not say this phrase and the flow will continue directly via the `permissionsGranted` outcome.
135
+
136
+ **Outcomes:**
137
+ - `permissionsGranted` — user granted the requested permissions (or they were already granted)
138
+ - `permissionsDenied` — user denied the permissions
139
+
140
+ ```typescript
141
+ {
142
+ id: "request-permissions",
143
+ type: "permissions",
144
+ prompt: "Say: Could you please enable your camera and microphone so we can proceed.",
145
+ permissions: {
146
+ camera: true,
147
+ microphone: true
148
+ },
149
+ outcomes: {
150
+ permissionsGranted: "next-node-id",
151
+ permissionsDenied: "end-denied"
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### LIVENESS_DETECTION Node
157
+
158
+ Checks whether the user in front of the camera is a real person or a deepfake. The node analyzes the video feed to perform liveness detection.
159
+
160
+ **Prerequisites:** The user must have camera access granted before this node. Additionally, liveness detection requires several seconds of video recording for analysis. Do not place this node immediately after a PERMISSIONS node — instead, add a CONVERSATION node in between to give the system time to accumulate video data for analysis.
161
+
162
+ **Recommended flow order:**
163
+ `PERMISSIONS → CONVERSATION → LIVENESS_DETECTION`
164
+
165
+ **Outcomes:**
166
+ - `livenessDetected` — the user is a real person
167
+ - `deepfakeDetected` — a deepfake or spoofing attempt was detected
168
+ - `noFace` — no face was detected in the camera feed
169
+
170
+ ```typescript
171
+ {
172
+ id: "liveness-check",
173
+ type: "liveness_detection",
174
+ outcomes: {
175
+ livenessDetected: "next-node-id",
176
+ deepfakeDetected: "end-fail",
177
+ noFace: "end-fail"
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### ENTER_EMAIL Node
183
+
184
+ Displays a UI for the user to enter their email address. The collected email can be used later in the flow for two-factor authentication or data collection purposes.
185
+
186
+ **Outcomes:**
187
+ - `emailEntered` — user submitted their email
188
+ - `canceled` — user canceled the email entry
189
+
190
+ ```typescript
191
+ {
192
+ id: "collect-email",
193
+ type: "enter_email",
194
+ outcomes: {
195
+ emailEntered: "next-node-id",
196
+ canceled: "end-canceled"
197
+ }
198
+ }
199
+ ```
200
+
201
+ ### DATA_VALIDATION Node
202
+
203
+ Validates data collected during the session and routes the flow based on the result. Uses a `validation` object to specify which field to check, what action to perform, and an optional expected value.
204
+
205
+ - `validation.field` — the data field to validate
206
+ - `validation.action` — the validation action to perform
207
+ - `validation.value` — optional expected value for comparison
208
+
209
+ Uses conditional outcomes (same as CONVERSATION node) to branch the flow based on the validation result.
210
+
211
+ ```typescript
212
+ {
213
+ id: "check-email-domain",
214
+ type: "data_validation",
215
+ validation: {
216
+ field: "email",
217
+ action: "contains",
218
+ value: "@company.com"
219
+ },
220
+ outcomes: [
221
+ { id: "valid", targetNodeId: "next-node-id", condition: "Validation passed" },
222
+ { id: "invalid", targetNodeId: "end-fail", condition: "Validation failed" }
223
+ ]
224
+ }
225
+ ```
226
+
227
+ ### DOCUMENT_SCAN Node
228
+
229
+ Opens a document scanning UI powered by Microblink. The user can scan identity documents using their camera. Extracted data (name, date of birth, document number, etc.) becomes available in the session report.
230
+
231
+ - `scanningMode` — determines how to scan the document:
232
+ - `"single"` — scan only one side of the document
233
+ - `"automatic"` — automatically determine how many sides need to be scanned
234
+ - `allowedDocumentTypes` — array of document types the user can scan (e.g., `"passport"`, `"id"`, `"dl"`, `"residence-permit"`, `"visa"`, etc.)
235
+ - `showTorchButton` — show flashlight toggle (default: true)
236
+ - `showCameraSwitch` — show front/back camera toggle (default: true)
237
+ - `showMirrorCameraButton` — show mirror camera button (default: true)
238
+
239
+ **Outcomes:**
240
+ - `scanSuccess` — document was scanned successfully
241
+ - `userCancelled` — user canceled the scan
242
+ - `scanTimeout` — scan timed out
243
+
244
+ ```typescript
245
+ {
246
+ id: "scan-id",
247
+ type: "document_scan",
248
+ scanningMode: "automatic",
249
+ allowedDocumentTypes: ["passport", "id", "dl"],
250
+ outcomes: {
251
+ scanSuccess: "next-node-id",
252
+ userCancelled: "end-canceled",
253
+ scanTimeout: "end-fail"
254
+ }
255
+ }
256
+ ```
257
+
258
+ ### RECOGNITION Node
259
+
260
+ Performs biometric face recognition to identify the user. Compares the user's face against previously registered faces to determine if they are a known or new user.
261
+
262
+ **Prerequisites:** Requires camera access. Like LIVENESS_DETECTION, needs several seconds of video for analysis — do not place immediately after a PERMISSIONS node. Add a CONVERSATION node in between to accumulate video data.
263
+
264
+ **Outcomes:**
265
+ - `recognized` — the user was matched to a known face
266
+ - `newUser` — the user's face was not found in the database (new user)
267
+ - `noFace` — no face was detected in the camera feed
268
+
269
+ ```typescript
270
+ {
271
+ id: "recognize-user",
272
+ type: "recognition",
273
+ outcomes: {
274
+ recognized: "welcome-back",
275
+ newUser: "registration-flow",
276
+ noFace: "end-fail"
277
+ }
278
+ }
279
+ ```
280
+
281
+ ### FACE_SCAN Node
282
+
283
+ Performs 1:1 biometric face matching. Captures the user's face and compares it against a reference image to verify their identity.
284
+
285
+ **Prerequisites:** Requires camera access. Like LIVENESS_DETECTION, needs several seconds of video — do not place immediately after a PERMISSIONS node.
286
+
287
+ - `captureInstructions` — optional text instructions shown to the user during capture
288
+ - `requireLivenessChallenge` — require an active liveness challenge during capture
289
+ - `requireAILivenessCheck` — require AI-based liveness verification
290
+ - `referenceImageKey` — key identifying the reference image to compare against
291
+ - `similarityThreshold` — minimum similarity score (0–1) required for a match
292
+ - `enableSound` — enable audio feedback (default: true)
293
+ - `enableHaptics` — enable haptic feedback (default: true)
294
+
295
+ **Outcomes:**
296
+ - `passed` — face matched the reference image
297
+ - `notPassed` — face did not match
298
+ - `cancelled` — user canceled the scan
299
+ - `error` — an error occurred during scanning
300
+
301
+ ```typescript
302
+ {
303
+ id: "face-verify",
304
+ type: "face_scan",
305
+ referenceImageKey: "document_photo",
306
+ similarityThreshold: 0.8,
307
+ requireAILivenessCheck: true,
308
+ outcomes: {
309
+ passed: "next-node-id",
310
+ notPassed: "end-fail",
311
+ cancelled: "end-canceled",
312
+ error: "end-error"
313
+ }
314
+ }
315
+ ```
316
+
317
+ ### TWO_FACTOR_EMAIL Node
318
+
319
+ Sends a one-time password (OTP) to the user's email address and verifies the code they enter. If no email was provided via `providedData` or collected by a previous node (e.g., ENTER_EMAIL), the email will be requested automatically during this node.
320
+
321
+ - `otpLength` — number of digits in the OTP (4–8, default: 6)
322
+ - `expirySeconds` — how long the OTP is valid (default: 300 / 5 minutes)
323
+ - `maxAttempts` — maximum verification attempts (default: 3)
324
+ - `resendAfterSeconds` — minimum delay before "Resend" button is enabled
325
+ - `showUI` — show on-screen toast notification (default: true)
326
+ - `emailTemplate` — optional custom email template
327
+
328
+ **Outcomes:**
329
+ - `verified` — user entered the correct OTP
330
+ - `delivery_failed` — OTP could not be delivered
331
+ - `failed_unverified` — user exhausted all attempts without verifying
332
+ - `cancelled` — user canceled the verification
333
+ - `error` — an error occurred
334
+
335
+ ```typescript
336
+ {
337
+ id: "email-2fa",
338
+ type: "two_factor_email",
339
+ otpLength: 6,
340
+ expirySeconds: 300,
341
+ maxAttempts: 3,
342
+ outcomes: {
343
+ verified: "next-node-id",
344
+ delivery_failed: "end-fail",
345
+ failed_unverified: "end-fail",
346
+ cancelled: "end-canceled",
347
+ error: "end-error"
348
+ }
349
+ }
350
+ ```
351
+
352
+ ### TWO_FACTOR_SMS Node
353
+
354
+ Same as TWO_FACTOR_EMAIL but sends the OTP via SMS. If no phone number was provided via `providedData` or collected by a previous node, the phone number will be requested automatically during this node.
355
+
356
+ - Same configuration options as TWO_FACTOR_EMAIL
357
+ - `smsTemplate` — optional custom SMS template (instead of `emailTemplate`)
358
+
359
+ ```typescript
360
+ {
361
+ id: "sms-2fa",
362
+ type: "two_factor_sms",
363
+ otpLength: 6,
364
+ expirySeconds: 300,
365
+ maxAttempts: 3,
366
+ outcomes: {
367
+ verified: "next-node-id",
368
+ delivery_failed: "end-fail",
369
+ failed_unverified: "end-fail",
370
+ cancelled: "end-canceled",
371
+ error: "end-error"
372
+ }
373
+ }
374
+ ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@facesignai/api",
3
3
  "package-name": "@facesignai/api",
4
- "version": "1.0.34",
4
+ "version": "1.0.36",
5
5
  "description": "Facesign API wrapper",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,4 +1,4 @@
1
- import { FSNodeType, FSNodeId, FSLivenessDetectionOutcome, FSEnterEmailOutcome, FSDocumentScanOutcome, FSRecognitionOutcome, FSFaceScanOutcome, FSTwoFactorOutcome, FSPermissionsOutcome } from "./nodes";
1
+ import { FSNodeType, FSNodeId, FSLivenessDetectionOutcome, FSEnterEmailOutcome, FSDocumentScanOutcome, FSRecognitionOutcome, FSFaceScanOutcome, FSTwoFactorOutcome, FSPermissionsOutcome, FSFaceCompareOutcome } from "./nodes";
2
2
  import { DocumentScanReport } from "./docScanning";
3
3
  export type NodeReportBase = {
4
4
  type: FSNodeType;
@@ -80,5 +80,17 @@ export type PermissionsNodeReport = NodeReportBase & {
80
80
  type: FSNodeType.PERMISSIONS;
81
81
  outcome: FSPermissionsOutcome;
82
82
  };
83
- export type NodeReport = ConversationNodeReport | LivenessDetectionNodeReport | EnterEmailNodeReport | DataValidationNodeReport | DocumentScanNodeReport | RecognitionNodeReport | TwoFactorEmailNodeReport | TwoFactorSMSNodeReport | FaceScanNodeReport | PermissionsNodeReport;
83
+ export type FaceCompareReport = {
84
+ isMatch: boolean;
85
+ similarity?: number;
86
+ sourceAImageFound: boolean;
87
+ sourceBImageFound: boolean;
88
+ error?: string;
89
+ };
90
+ export type FaceCompareNodeReport = NodeReportBase & {
91
+ type: FSNodeType.FACE_COMPARE;
92
+ outcome: FSFaceCompareOutcome;
93
+ report?: FaceCompareReport;
94
+ };
95
+ export type NodeReport = ConversationNodeReport | LivenessDetectionNodeReport | EnterEmailNodeReport | DataValidationNodeReport | DocumentScanNodeReport | RecognitionNodeReport | TwoFactorEmailNodeReport | TwoFactorSMSNodeReport | FaceScanNodeReport | PermissionsNodeReport | FaceCompareNodeReport;
84
96
  //# sourceMappingURL=nodeReports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeReports.d.ts","sourceRoot":"","sources":["../../../src/types/nodeReports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,QAAQ,EACR,0BAA0B,EAC1B,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,KAAK,CAAA;CAAE,GACtC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GACtC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAA;AAE1C,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG;IACtD,IAAI,EAAE,UAAU,CAAC,gBAAgB,CAAA;IACjC,OAAO,EAAE,kBAAkB,CAAA;IAC3B,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IACpD,IAAI,EAAE,UAAU,CAAC,cAAc,CAAA;IAC/B,OAAO,EAAE,kBAAkB,CAAA;IAC3B,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,OAAO,CAAA;IAC7B,oBAAoB,EAAE,OAAO,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AM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,oBAAoB,CAAA;IAC7B,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,UAAU,GAClB,sBAAsB,GACtB,2BAA2B,GAC3B,oBAAoB,GACpB,wBAAwB,GACxB,sBAAsB,GACtB,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,kBAAkB,GAClB,qBAAqB,GACrB,qBAAqB,CAAA"}
@@ -12,13 +12,18 @@ export declare enum FSNodeType {
12
12
  FACE_SCAN = "face_scan",
13
13
  TWO_FACTOR_EMAIL = "two_factor_email",
14
14
  TWO_FACTOR_SMS = "two_factor_sms",
15
- PERMISSIONS = "permissions"
15
+ PERMISSIONS = "permissions",
16
+ FACE_COMPARE = "face_compare"
16
17
  }
17
18
  export interface FSNodeBase {
18
19
  id: string;
19
20
  type: FSNodeType;
20
21
  }
21
22
  export type FSNodeId = string;
23
+ /**
24
+ * The entry point of every flow. Each flow must have exactly one START node.
25
+ * It has a single `outcome` that points to the first node in the flow.
26
+ */
22
27
  export interface FSStartNode extends FSNodeBase {
23
28
  type: FSNodeType.START;
24
29
  outcome: FSNodeId;
@@ -28,6 +33,19 @@ export interface FSConditionalOutcome {
28
33
  targetNodeId: string;
29
34
  condition: string;
30
35
  }
36
+ /**
37
+ * The avatar speaks to the user using the `prompt` text and routes the flow based on the user's response.
38
+ * The session stays on this node until one of the outcome conditions matches, enabling multi-turn dialog.
39
+ *
40
+ * The `prompt` supports two modes:
41
+ * - Direct speech: "Say: Hi, how are you doing?"
42
+ * - Goal-driven behavior: "Chat with the user and assess their medical knowledge."
43
+ *
44
+ * When using goal-driven prompts, always include realistic exit conditions in the outcomes
45
+ * (e.g., user didn't respond after 3 attempts, dialog reached N exchanges, user refuses to answer).
46
+ *
47
+ * Set `doesNotRequireReply: true` for final messages before an END node where no user response is needed.
48
+ */
31
49
  export interface FSConversationNode extends FSNodeBase {
32
50
  type: FSNodeType.CONVERSATION;
33
51
  prompt: string;
@@ -39,6 +57,15 @@ export declare enum FSLivenessDetectionOutcome {
39
57
  DEEPFAKE_DETECTED = "deepfakeDetected",
40
58
  NO_FACE = "noFace"
41
59
  }
60
+ /**
61
+ * Checks whether the user is a real person or a deepfake by analyzing the video feed.
62
+ *
63
+ * Requires camera access. Needs several seconds of video for analysis —
64
+ * do not place immediately after a PERMISSIONS node. Add a CONVERSATION node
65
+ * in between to accumulate video data.
66
+ *
67
+ * Recommended flow order: PERMISSIONS → CONVERSATION → LIVENESS_DETECTION
68
+ */
42
69
  export interface FSLivenessDetectionNode extends FSNodeBase {
43
70
  type: FSNodeType.LIVENESS_DETECTION;
44
71
  outcomes: Record<FSLivenessDetectionOutcome, FSNodeId>;
@@ -47,10 +74,19 @@ export declare enum FSEnterEmailOutcome {
47
74
  EMAIL_ENTERED = "emailEntered",
48
75
  CANCELED = "canceled"
49
76
  }
77
+ /**
78
+ * Displays a UI for the user to enter their email address.
79
+ * The collected email can be used later in the flow for two-factor authentication or data collection.
80
+ */
50
81
  export interface FSEnterEmailNode extends FSNodeBase {
51
82
  type: FSNodeType.ENTER_EMAIL;
52
83
  outcomes: Record<FSEnterEmailOutcome, FSNodeId>;
53
84
  }
85
+ /**
86
+ * Validates data collected during the session and routes the flow based on the result.
87
+ * Uses a `validation` object to specify which field to check, what action to perform,
88
+ * and an optional expected value. Uses conditional outcomes to branch the flow.
89
+ */
54
90
  export interface FSDataValidationNode extends FSNodeBase {
55
91
  type: FSNodeType.DATA_VALIDATION;
56
92
  outcomes: NonEmptyArray<FSConditionalOutcome>;
@@ -65,6 +101,13 @@ export declare enum FSRecognitionOutcome {
65
101
  NEW_USER = "newUser",
66
102
  NO_FACE = "noFace"
67
103
  }
104
+ /**
105
+ * Performs biometric face recognition to identify the user.
106
+ * Compares the user's face against previously registered faces.
107
+ *
108
+ * Requires camera access. Like LIVENESS_DETECTION, needs several seconds of video —
109
+ * do not place immediately after a PERMISSIONS node. Add a CONVERSATION node in between.
110
+ */
68
111
  export interface FSRecognitionNode extends FSNodeBase {
69
112
  type: FSNodeType.RECOGNITION;
70
113
  outcomes: Record<FSRecognitionOutcome, FSNodeId>;
@@ -76,6 +119,14 @@ export declare enum FSDocumentScanOutcome {
76
119
  TIMEOUT = "scanTimeout"
77
120
  }
78
121
  export type FSDocumentScanMode = ScanningMode;
122
+ /**
123
+ * Opens a document scanning UI powered by Microblink. The user can scan identity documents
124
+ * using their camera. Extracted data becomes available in the session report.
125
+ *
126
+ * `scanningMode`:
127
+ * - "single" — scan only one side of the document
128
+ * - "automatic" — automatically determine how many sides need to be scanned
129
+ */
79
130
  export interface FSDocumentScanNode extends FSNodeBase {
80
131
  type: FSNodeType.DOCUMENT_SCAN;
81
132
  scanningMode: FSDocumentScanMode;
@@ -85,6 +136,10 @@ export interface FSDocumentScanNode extends FSNodeBase {
85
136
  showCameraSwitch?: boolean;
86
137
  showMirrorCameraButton?: boolean;
87
138
  }
139
+ /**
140
+ * The terminal node of a flow. A flow can have multiple END nodes
141
+ * (e.g., one for success path, one for failure path). It has no outcomes.
142
+ */
88
143
  export interface FSEndNode extends FSNodeBase {
89
144
  type: FSNodeType.END;
90
145
  }
@@ -94,6 +149,13 @@ export declare enum FSFaceScanOutcome {
94
149
  CANCELLED = "cancelled",
95
150
  ERROR = "error"
96
151
  }
152
+ /**
153
+ * Performs 1:1 biometric face matching. Captures the user's face and compares it
154
+ * against a reference image to verify their identity.
155
+ *
156
+ * Requires camera access. Like LIVENESS_DETECTION, needs several seconds of video —
157
+ * do not place immediately after a PERMISSIONS node.
158
+ */
97
159
  export interface FSFaceScanNode extends FSNodeBase {
98
160
  type: FSNodeType.FACE_SCAN;
99
161
  outcomes: Record<FSFaceScanOutcome, FSNodeId>;
@@ -116,6 +178,12 @@ export declare enum FSTwoFactorOutcome {
116
178
  CANCELLED = "cancelled",
117
179
  ERROR = "error"
118
180
  }
181
+ /**
182
+ * Base interface for two-factor authentication nodes (email and SMS).
183
+ * Sends a one-time password (OTP) and verifies the code the user enters.
184
+ * If the required contact info (email or phone) was not provided via `providedData`
185
+ * or collected by a previous node, it will be requested automatically during this node.
186
+ */
119
187
  export interface FSTwoFactorNode extends FSNodeBase {
120
188
  outcomes: Record<FSTwoFactorOutcome, FSNodeId>;
121
189
  otpLength?: number;
@@ -132,6 +200,15 @@ export interface FSTwoFactorNodeSMS extends FSTwoFactorNode {
132
200
  type: FSNodeType.TWO_FACTOR_SMS;
133
201
  smsTemplate?: string;
134
202
  }
203
+ /**
204
+ * Requests camera and/or microphone permissions from the user.
205
+ * Use when you need a custom prompt or want to handle the denied case with a specific flow path.
206
+ * If the flow has no PERMISSIONS node, permissions are requested automatically.
207
+ *
208
+ * The `prompt` uses direct speech mode (e.g., "Say: Could you please enable your microphone so I can hear you.").
209
+ * If the site already has permanent permissions granted, the avatar will not say this phrase
210
+ * and the flow continues directly via the `permissionsGranted` outcome.
211
+ */
135
212
  export interface FSPermissionsNode extends FSNodeBase {
136
213
  prompt?: string;
137
214
  type: FSNodeType.PERMISSIONS;
@@ -145,5 +222,45 @@ export declare enum FSPermissionsOutcome {
145
222
  PERMISSIONS_GRANTED = "permissionsGranted",
146
223
  PERMISSIONS_DENIED = "permissionsDenied"
147
224
  }
148
- export type FSNode = FSStartNode | FSConversationNode | FSEndNode | FSEnterEmailNode | FSLivenessDetectionNode | FSDataValidationNode | FSDocumentScanNode | FSRecognitionNode | FSFaceScanNode | FSTwoFactorNodeEmail | FSTwoFactorNodeSMS;
225
+ export declare enum FSFaceCompareSource {
226
+ SESSION_VIDEO = "sessionVideo",
227
+ FACE_SCAN = "faceScan",
228
+ PROVIDED_DATA = "providedData",
229
+ DOCUMENT_PHOTO = "documentPhoto"
230
+ }
231
+ export type FSFaceCompareSourceConfig = {
232
+ source: FSFaceCompareSource.SESSION_VIDEO;
233
+ } | {
234
+ source: FSFaceCompareSource.FACE_SCAN;
235
+ } | {
236
+ source: FSFaceCompareSource.PROVIDED_DATA;
237
+ providedDataKey: string;
238
+ } | {
239
+ source: FSFaceCompareSource.DOCUMENT_PHOTO;
240
+ };
241
+ export declare enum FSFaceCompareOutcome {
242
+ MATCH = "match",
243
+ NO_MATCH = "noMatch",
244
+ IMAGE_UNAVAILABLE = "imageUnavailable"
245
+ }
246
+ /**
247
+ * Compares faces from two different sources to verify they belong to the same person.
248
+ *
249
+ * Available sources:
250
+ * - `sessionVideo` — frame captured from the live video feed during the session
251
+ * - `faceScan` — higher-quality photo from a FACE_SCAN node (oval capture)
252
+ * - `providedData` — image URL from a `providedData` field (specify the key via `providedDataKey`)
253
+ * - `documentPhoto` — photo extracted from a scanned document (DOCUMENT_SCAN node)
254
+ *
255
+ * For `faceScan` and `documentPhoto`, the photo is taken from the most recent
256
+ * completed node of that type in the session.
257
+ */
258
+ export interface FSFaceCompareNode extends FSNodeBase {
259
+ type: FSNodeType.FACE_COMPARE;
260
+ sourceA: FSFaceCompareSourceConfig;
261
+ sourceB: FSFaceCompareSourceConfig;
262
+ outcomes: Record<FSFaceCompareOutcome, FSNodeId>;
263
+ similarityThreshold?: number;
264
+ }
265
+ export type FSNode = FSStartNode | FSConversationNode | FSEndNode | FSEnterEmailNode | FSLivenessDetectionNode | FSDataValidationNode | FSDocumentScanNode | FSRecognitionNode | FSFaceScanNode | FSTwoFactorNodeEmail | FSTwoFactorNodeSMS | FSPermissionsNode | FSFaceCompareNode;
149
266
  //# sourceMappingURL=nodes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../src/types/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAE1D,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/C,oBAAY,UAAU;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,mBAAmB,uBAAuB;IAC1C,kBAAkB,sBAAsB;CACzC;AAED,oBAAY,mBAAmB;IAC7B,aAAa,iBAAiB;IAC9B,SAAS,aAAa;IACtB,aAAa,iBAAiB;IAC9B,cAAc,kBAAkB;CACjC;AAED,MAAM,MAAM,yBAAyB,GACjC;IAAE,MAAM,EAAE,mBAAmB,CAAC,aAAa,CAAA;CAAE,GAC7C;IAAE,MAAM,EAAE,mBAAmB,CAAC,SAAS,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,mBAAmB,CAAC,aAAa,CAAC;IAAC,eAAe,EAAE,MAAM,CAAA;CAAE,GACtE;IAAE,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAA;CAAE,CAAA;AAElD,oBAAY,oBAAoB;IAC9B,KAAK,UAAU;IACf,QAAQ,YAAY;IACpB,iBAAiB,qBAAqB;CACvC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAA;IAC7B,OAAO,EAAE,yBAAyB,CAAA;IAClC,OAAO,EAAE,yBAAyB,CAAA;IAClC,QAAQ,EAAE,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAA;IAChD,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,MAAM,MAAM,GACd,WAAW,GACX,kBAAkB,GAClB,SAAS,GACT,gBAAgB,GAChB,uBAAuB,GACvB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FSPermissionsOutcome = exports.FSTwoFactorOutcome = exports.FSTwoFactorChannel = exports.FSFaceScanOutcome = exports.FSDocumentScanOutcome = exports.FSRecognitionOutcome = exports.FSEnterEmailOutcome = exports.FSLivenessDetectionOutcome = exports.FSNodeType = void 0;
3
+ exports.FSFaceCompareOutcome = exports.FSFaceCompareSource = exports.FSPermissionsOutcome = exports.FSTwoFactorOutcome = exports.FSTwoFactorChannel = exports.FSFaceScanOutcome = exports.FSDocumentScanOutcome = exports.FSRecognitionOutcome = exports.FSEnterEmailOutcome = exports.FSLivenessDetectionOutcome = exports.FSNodeType = void 0;
4
4
  var FSNodeType;
5
5
  (function (FSNodeType) {
6
6
  FSNodeType["START"] = "start";
@@ -15,6 +15,7 @@ var FSNodeType;
15
15
  FSNodeType["TWO_FACTOR_EMAIL"] = "two_factor_email";
16
16
  FSNodeType["TWO_FACTOR_SMS"] = "two_factor_sms";
17
17
  FSNodeType["PERMISSIONS"] = "permissions";
18
+ FSNodeType["FACE_COMPARE"] = "face_compare";
18
19
  })(FSNodeType = exports.FSNodeType || (exports.FSNodeType = {}));
19
20
  var FSLivenessDetectionOutcome;
20
21
  (function (FSLivenessDetectionOutcome) {
@@ -67,3 +68,16 @@ var FSPermissionsOutcome;
67
68
  FSPermissionsOutcome["PERMISSIONS_GRANTED"] = "permissionsGranted";
68
69
  FSPermissionsOutcome["PERMISSIONS_DENIED"] = "permissionsDenied";
69
70
  })(FSPermissionsOutcome = exports.FSPermissionsOutcome || (exports.FSPermissionsOutcome = {}));
71
+ var FSFaceCompareSource;
72
+ (function (FSFaceCompareSource) {
73
+ FSFaceCompareSource["SESSION_VIDEO"] = "sessionVideo";
74
+ FSFaceCompareSource["FACE_SCAN"] = "faceScan";
75
+ FSFaceCompareSource["PROVIDED_DATA"] = "providedData";
76
+ FSFaceCompareSource["DOCUMENT_PHOTO"] = "documentPhoto";
77
+ })(FSFaceCompareSource = exports.FSFaceCompareSource || (exports.FSFaceCompareSource = {}));
78
+ var FSFaceCompareOutcome;
79
+ (function (FSFaceCompareOutcome) {
80
+ FSFaceCompareOutcome["MATCH"] = "match";
81
+ FSFaceCompareOutcome["NO_MATCH"] = "noMatch";
82
+ FSFaceCompareOutcome["IMAGE_UNAVAILABLE"] = "imageUnavailable";
83
+ })(FSFaceCompareOutcome = exports.FSFaceCompareOutcome || (exports.FSFaceCompareOutcome = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@facesignai/api",
3
3
  "package-name": "@facesignai/api",
4
- "version": "1.0.34",
4
+ "version": "1.0.36",
5
5
  "description": "Facesign API wrapper",
6
6
  "repository": {
7
7
  "type": "git",