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
3
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.1.0
  • npm
  • Socket score

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

@caf.io/react-native-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 @caf.io/react-native-face-liveness
# or 
npm install @caf.io/react-native-face-liveness

Usage

TypeScript

import React from 'react';
import { View, Button, StyleSheet } from 'react-native';
import { 
  startFaceLiveness,
  useFaceLiveness, 
  FaceLivenessOptions, 
  StageType, 
  FilterType, 
  TimeType 
} from '@caf.io/react-native-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 { 
    result, 
    error, 
    cancelled, 
    isLoading 
  } = useFaceLiveness(options);

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

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

Methods

startFaceLiveness

This method inicialize the face liveness.

Params

ParamTypeDefaultDescription
mobileTokenstringRequiredUsage token associated with your Identity account
peopleIdstringRequiredUser CPF

Hooks

useFaceLiveness

This hook provides the responses of method startFaceLiveness and make the settings for face liveness.

Params

ParamTypeDefaultDescription
optionsFaceLivenessOptionsOptionalSettings for the 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
DEVDevelopment 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 06 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