![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@privateid/privid-fhe-modules
Advanced tools
Powered by Private Identity®
https://private.id
CryptoNets™ Wasm Module Implementation is an npm package that uses the W3C WebAssembly to perform 1:N fully homomorphically encrypted (FHE) face recognition.
Sign up on the waitlist on https://private.id to obtain your apiKey.
Installation
npm install @privateid/privid-fhe-modules
Copy the necessary dependencies to the public folder of your app
"prestart": "cp -R ./node_modules/@privateid/privid-fhe-modules/wasm public/&& cp -R ./node_modules/@privateid/privid-fhe-modules/workers public/",
"prebuild": "cp -R ./node_modules/@privateid/privid-fhe-modules/wasm public/ && cp -R ./node_modules/@privateid/privid-fhe-modules/workers public/"
Add the necessary environment variables on the .env file in the root of your project
SKIP_PREFLIGHT_CHECK=true
REACT_APP_API_URL=
REACT_APP_API_KEY=
REACT_APP_WASM_MODULE= face_mask | face | voice
The first step is to load and initialize the wasm module and clear the content of the local database.
import { loadPrivIdModule, clearDB } from '@privateid/privid-fhe-modules';
await loadPrivIdModule();
clearDB();
The first step is to load and initialize the wasm module.
To open user camera use the openCamera function with element id of the video tag in the DOM
import { openCamera } from '@privateid/privid-fhe-modules';
const { devices, faceMode } = await openCamera(element);
it returns list of the available video devices.
To switch to another media device use the switchCamera function with the ID of the device to be used
import { switchCamera } from '@privateid/privid-fhe-modules';
switchCamera(deviceID);
for the mobile phone we can select whether it's front or back camera for this we pass 'front' or 'back' to the switch function
import { switchCamera } from '@privateid/privid-fhe-modules';
switchCamera('front');
Live demo: [https://age.devel.private.id]
isValid only exercises the is_valid()
call and does not find identity. The function detects if there is a valid face in the camera view or in an ImageData Array.
isValid accepts two parameters.
import { isValid } from '@privateid/privid-fhe-modules';
const {result, imageData} = isValid (false);
Face CAPTCHA returns 17 possible coded results, as follows.
Property | Description |
---|---|
-1 | No Face |
0 | Valid Biometric |
1 | Image Spoof |
2 | Video Spoof |
3 | Too close |
4 | Too far away |
5 | Too far to right |
6 | Too far to left |
7 | Too far up |
8 | Too far down |
9 | Too blurry |
10 | Glasses on |
11 | Mask on |
12 | Chin too far left |
13 | Chin too far right |
14 | Chin too far up |
15 | Chin too far down |
Perform a new enrollment (register a new user) or predict (authenticate a user) using the enrollPredict
function
import { enrollPredict } from '@privateid/privid-fhe-modules';
enrollPredict('userVideo', false, callback)
The function takes 3 parameters
Property | Description |
---|---|
videoRef | Video tag |
action | True (enroll) / false (predict) |
callback | The callback to be executed on each status |
The enrollPredict
function provides 5 status updates to allow the developer to take action at different steps of the identification process.
Status | Description |
---|---|
VALID_FACE | A face is detected |
INVALID_FACE | A valid face is not detected |
ENROLLING | Enrollment (registration) starts of a valid face |
PREDICTING | Prediction (authentication) starts of a valid face |
WASM_RESPONSE | The prediction or enrollment process is complete |
Live demo: https://c.priv.id
Perform continuous user enrollment or prediction (registration or authentication) using the continuousEnrollPredict
function. This provides the same status updates as Enroll or Predict.
import { continuousEnrollPredict } from '@privateid/privid-fhe-modules';
continuousEnrollPredict(false, callback)
The continousEnrollPredict function takes 2 parameters
Property | Description |
---|---|
action | True (enroll) / false (predict) |
callback | The callback to be executed on each status |
This function finds, crops, align and validate, front and back of the photoID, and returns back a valid cropped and aligned image of the photoID
The isValidPhotoID function takes 3 parameters
Property | Description |
---|---|
docType | it can be either PHOTO_ID_BACK (back of the photo ID) or PHOTO_ID_FRONT (front of the photo ID) |
callback | returns the uuid of the portrait on the Front of the Photo ID |
The function returns
result: status of the validation of the document
Status | Description |
---|---|
0 | valid document |
1 |
href: aligned and cropped image of the document returned in case of valid document
confScore: confidence score indicates if the image contains the 4 corners of the document, without fingers or objects hidding the document, it goes from 0 to 1.
Licensing Restriction: This product is not licensed for use in regulated gaming. To license in this market, please contact CentralAMS.
FAQs
CryptoNets WebAssembly SDK
We found that @privateid/privid-fhe-modules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.