Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@caf.io/react-native-face-liveness

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@caf.io/react-native-face-liveness

CAF React Native library for face liveness

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
363
increased by8.68%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-caf-face-liveness

About

Library for React Native


Minimum Requirements

Android

SettingsMinimum version
minSdkVersion21
compileSdkVersion33
Java version8

iOS

SettingsMinimum version
Target12
Xcode13.4.1

Getting Started

yarn add react-native-caf-face-liveness
# or 
npm install react-native-caf-face-liveness

Usage

TypeScript

import React from 'react';
import { View, Button, StyleSheet } from 'react-native';
import { 
  useFaceLiveness, 
  FaceLivenessOptions, 
  StageType, 
  FilterType, 
  TimeType 
} from 'react-native-caf-face-liveness';

export default function App() {
  const mobileToken: string = "";
  const peopleId: string = "";

  const options: FaceLivenessOptions = {
    cafStage: StageType.PROD;
    filter: FilterType.NATURAL;
    imageUrlExpirationTime: TimeType.THREE_HOURS;
    enableScreenshots: true;
    loadingScreen: true;
  } // optional

  const { 
    startFaceLiveness, 
    result, 
    error, 
    cancelled, 
    isLoading 
  } = useFaceLiveness(mobileToken, peopleId, options);

  return (
    <View style={styles.container}>
      <Button title="Press" onPress={startFaceLiveness} />
    </View>
  );
} 

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
});

Hooks

useFaceLiveness

This hook provides startFaceLiveness method that start face liveness and your responses.

Params

ParamTypeDefaultDescription
mobileTokenstringRequiredUsage token associated with your Identity account
peopleIdstringRequiredUser CPF
optionsFaceLivenessOptionsOptionalSettings for the face liveness

Methods

MethodParamsResponseDescriptions
startFaceLivenessvoidvoidMethod that start face liveness

Responses

FaceLivenessResponse


Types

FaceLivenessResponse

NameTypeDescription
resultstring or nullShows when face liveness returns a successful capture
errorstring or nullShows when the face livenes return some error
cancelledbooleanShows when user cancel the liveness
isLoadingbooleanShows when the face liveness is loading

FaceLivenessOptions

NameTypeDescription
cafStageStageTypeChange the development environment
filterFilterTypeChange face liveness mask
imageUrlExpirationTimeTimeTypeChange the expiration time of the face liveness url
enableScreenshotsbooleanToggle user screenshots
loadingScreenbooleanToggle face liveness loading screen

Enums

StageType

EnumDescription
BETABeta environment
PRODProduction environment
DEVDevelppment environment

FilterType

EnumDescription
LINE_DRAWINGAlternative mask for face liveness
NATURALNormal mask for face liveness

TimeType

EnumDescription
THREE_HOURSImage url expiration time expires in three hours
THIRTY_DAYSImage url expiration time expires in thirty days
THIRTY_MINImage url expiration time expires in thirty minutes

Keywords

FAQs

Package last updated on 03 Jan 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc