@rick427/react-native-liveness 0.1.0 → 0.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.
Files changed (2) hide show
  1. package/README.md +35 -15
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @rick427/react-native-liveness
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@rick427/react-native-liveness?style=flat-square&color=brightgreen)](https://www.npmjs.com/package/@rick427/react-native-liveness)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@rick427/react-native-liveness?style=flat-square&color=blue)](https://www.npmjs.com/package/@rick427/react-native-liveness)
5
+ [![CI](https://img.shields.io/github/actions/workflow/status/rick427/react-native-liveness/ci.yml?style=flat-square&label=CI)](https://github.com/rick427/react-native-liveness/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-yellow?style=flat-square)](./LICENSE)
7
+ [![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20Android-lightgrey?style=flat-square)](https://github.com/rick427/react-native-liveness)
8
+
3
9
  A React Native library for real-time **liveness detection** using the device's front camera. Powered by [Vision Camera v4](https://github.com/mrousavy/react-native-vision-camera) and **ML Kit Face Detection** — no server required, fully on-device.
4
10
 
5
11
  The library scores each camera frame against a set of liveness signals (face size, head pose, eye openness), confirms liveness after a sustained high-score window, then automatically counts down **3 → 2 → 1**, plays a shutter sound, and captures the photo.
@@ -18,41 +24,55 @@ The library scores each camera frame against a set of liveness signals (face siz
18
24
 
19
25
  ---
20
26
 
21
- ## Prerequisites
27
+ ## Installation
22
28
 
23
- Install and link these peer dependencies in your project before using `@rick427/react-native-liveness`:
29
+ ```sh
30
+ npm install @rick427/react-native-liveness
31
+ # or
32
+ yarn add @rick427/react-native-liveness
33
+ ```
34
+
35
+ ### Peer dependencies
36
+
37
+ Install these if you don't already have them:
24
38
 
25
39
  | Package | Version |
26
40
  |---|---|
27
41
  | `react-native-vision-camera` | `>= 4.0.0` |
28
- | `react-native-worklets-core` | `>= 1.0.0` |
29
42
  | `react-native-svg` | `>= 13.0.0` |
43
+ | `react-native-worklets-core` | `>= 1.0.0` |
30
44
 
31
45
  ```sh
32
- npm install react-native-vision-camera react-native-worklets-core react-native-svg
46
+ npm install react-native-vision-camera react-native-svg react-native-worklets-core
33
47
  ```
34
48
 
35
- ---
49
+ ### Configure worklets Babel plugin
36
50
 
37
- ## Installation
51
+ The library uses Vision Camera frame processors which run in a worklet context. Add the appropriate plugin to your `babel.config.js` depending on which package you have installed:
38
52
 
39
- ```sh
40
- npm install @rick427/react-native-liveness
41
- # or
42
- yarn add @rick427/react-native-liveness
53
+ ```js
54
+ // babel.config.js
55
+ module.exports = {
56
+ presets: ['module:@react-native/babel-preset'], // or 'babel-preset-expo'
57
+ plugins: [
58
+ ['react-native-worklets-core/plugin'], // if using react-native-worklets-core
59
+ // ['react-native-worklets/plugin'], // if using react-native-worklets
60
+ ],
61
+ };
43
62
  ```
44
63
 
45
- Then install the peer dependencies if you haven't already:
64
+ > **Already have worklets configured?** Just confirm the relevant plugin line is present — no further changes needed.
65
+
66
+ After updating the Babel config, clear the Metro cache:
46
67
 
47
68
  ```sh
48
- npm install react-native-vision-camera react-native-worklets-core react-native-svg
49
- cd ios && pod install
69
+ npx react-native start --reset-cache
70
+ # or with Expo
71
+ npx expo start --clear
50
72
  ```
51
73
 
52
74
  ### iOS
53
75
 
54
- Add the ML Kit pod (already declared in the podspec, but run pod install):
55
-
56
76
  ```sh
57
77
  cd ios && pod install
58
78
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rick427/react-native-liveness",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Liveness detection library for React Native using Vision Camera v4 and ML Kit",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",