@richard.fadiora/liveness-detection 3.1.1 → 4.0.0

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
@@ -1,27 +1,31 @@
1
- # Liveness Detection Component
1
+ # Liveness Detection SDK
2
2
 
3
- A React-based liveness detection component that performs randomized user challenges and verifies real-user presence via a backend anti-spoofing API.
3
+ A cross-framework **liveness detection SDK** that performs randomized user challenges and verifies real-user presence via a backend anti-spoofing API. Works with **React** and **Angular** via framework-specific wrappers while the **core engine is framework-agnostic**.
4
4
 
5
- This version introduces **headless mode**, **render-prop customization**, and robust **challenge sequencing**, **configurable thresholds** for `Smile`, `Blink`, and `Turn_Head` challenges
5
+ This version introduces:
6
6
 
7
- Pause between steps for user feedback
8
-
9
- Sequential challenge execution with strict timeout handling allowing you to fully control the UI while keeping the verification logic encapsulated.
7
+ - **Headless mode** for fully custom UI
8
+ - Robust **challenge sequencing**
9
+ - **Configurable thresholds** for `Smile`, `Blink`, and `Turn_Head` challenges
10
+ - Sequential challenge execution with **strict timeout handling**
11
+ - Pause between steps for user feedback
12
+ - Cross-framework integration (React hook & Angular service)
10
13
 
11
14
  ---
12
15
 
13
16
  ## 📌 Overview
14
17
 
15
- This component strengthens identity verification by combining:
18
+ This SDK strengthens identity verification by combining:
16
19
 
17
20
  - Randomized challenge-response validation
21
+ - Sequential challenge execution
18
22
  - Strict timeout enforcement
19
23
  - Backend spoof detection
20
24
  - Callback-based integration for easy usage
21
- - Headless / fully customizable UI via render props
22
- - Configurable challenge thresholds to adapt difficulty
25
+ - Headless / fully customizable UI via render props (React)
26
+ - Configurable challenge thresholds
23
27
 
24
- It protects against:
28
+ Protects against:
25
29
 
26
30
  - Presentation (photo) attacks
27
31
  - Screen glare attacks
@@ -29,6 +33,29 @@ It protects against:
29
33
 
30
34
  ---
31
35
 
36
+ ## ⚙️ Architecture
37
+
38
+ ### Core Engine
39
+
40
+ - `LivenessEngine` (framework-agnostic)
41
+ - Handles:
42
+ - Challenge sequence generation
43
+ - MediaPipe face & hand model detection
44
+ - Challenge validation (`Smile`, `Blink`, `Turn_Head`, `Thumbs_Up`)
45
+ - Face cropping
46
+ - Detection loop
47
+ - Final frame capture and backend verification
48
+ - Can be used directly or via React/Angular wrappers
49
+
50
+ ### Framework Wrappers
51
+
52
+ | Framework | Wrapper | Notes |
53
+ |-----------|--------|------|
54
+ | React | `useLiveness` hook | Uses `webcamRef` and React state, supports render-prop customization |
55
+ | Angular | `LivenessService` | Injectable service, exposes engine state and control methods |
56
+
57
+ ---
58
+
32
59
  ## ⚙️ How It Works
33
60
 
34
61
  ### 1️⃣ Challenge Initialization