@richard.fadiora/liveness-detection 3.1.0 → 3.1.1
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 +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,6 +133,25 @@ export default App;
|
|
|
133
133
|
)}
|
|
134
134
|
/>
|
|
135
135
|
```
|
|
136
|
+
## 📤 Hook Return Values
|
|
137
|
+
|
|
138
|
+
The `useLiveness` hook exposes the following values and control functions for managing the liveness detection session.
|
|
139
|
+
|
|
140
|
+
| Name | Type | Description |
|
|
141
|
+
|-----|------|-------------|
|
|
142
|
+
| `webcamRef` | `ref` | React ref attached to the webcam component. Provides access to the live video stream used for face and hand detection as well as frame capture for verification. |
|
|
143
|
+
| `status` | `string` | Represents the current state of the liveness session. Possible values include `loading`, `ready`, `capturing`, `verifying`, `success`, `error`, and `expired`. |
|
|
144
|
+
| `errorMsg` | `string` | Contains the error message displayed when the liveness verification fails or when the system encounters an issue. |
|
|
145
|
+
| `sequence` | `string[]` | The randomized sequence of liveness challenges selected for the current session. Three challenges are chosen from the challenge pool. |
|
|
146
|
+
| `currentStep` | `number` | The index of the current challenge being performed within the challenge sequence. |
|
|
147
|
+
| `timeLeft` | `number` | Remaining time (in seconds) before the session expires. The timer runs while the system is in the `capturing` state. |
|
|
148
|
+
| `isStepTransitioning` | `boolean` | Indicates whether the system is currently transitioning between challenges. Used to briefly pause detection and provide UI feedback after a challenge is completed. |
|
|
149
|
+
| `start` | `function` | Starts the liveness challenge session and begins the detection loop. |
|
|
150
|
+
| `reset` | `function` | Resets the entire session, including the timer, challenge sequence, step index, and error state. |
|
|
151
|
+
| `sendFinalProof` | `function` | Sends captured face frames to the backend verification API to perform the final liveness check. Normally triggered automatically after the last challenge is completed. |
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
136
155
|
|
|
137
156
|
---
|
|
138
157
|
|