npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gooddollar/react-native-facetec

v1.0.45

Published

React Native module that integrates FaceTec face verification API

Downloads

571

Readme

ReactNative FaceTec SDK Integration

Getting started

$ npm install @gooddollar/react-native-facetec --save

Mostly automatic installation

$ react-native link @gooddollar/react-native-facetec

Usage

import FaceTec from '@gooddollar/react-native-facetec';
import Config from 'react-native-config'

const {
  REACT_APP_ZOOM_ENCRYPTION_KEY,
  REACT_APP_ZOOM_LICENSE_KEY,
  REACT_APP_ZOOM_LICENSE_TEXT,
  REACT_APP_SERVER_URL = 'http://localhost:3003',
  REACT_APP_SERVER_TOKEN,
  REACT_APP_ENROLLMENT_IDENTIFIER,
} = Config

// ... some component body
useEffect(() => {
  FaceTec.sdk.initialize(
    REACT_APP_SERVER_URL,
    REACT_APP_SERVER_TOKEN,
    REACT_APP_ZOOM_LICENSE_KEY,
    REACT_APP_ZOOM_ENCRYPTION_KEY,
    REACT_APP_ZOOM_LICENSE_TEXT
  )
  .then(() => { /* on initialized handler here */ })
  .catch(e => { /* initialized failed handler here */ })
}, [])

const onMyButtonClicked = useCallback(() => {
  FaceTec.sdk.enroll(REACT_APP_ENROLLMENT_IDENTIFIER, 3, 60000)
    .then(() => { /* verification successfull handler here */ })
    .catch(() => { /* verification failed handler here */ })
}, [])

Handling exceptions

import FaceTec, { FaceTecSDKStatus, FaceTecSessionStatus } from '@gooddollar/react-native-facetec';

// ...
FaceTec.sdk.initialize(...).then(...)
  .catch(exception => {
    // see platform API docs for complete status codes list
    if (exception.code === FaceTecSDKStatus.DeviceNotSupported) {
      // suggest user to use another device
    }
  })

FaceTec.sdk.enroll(...).then(...)
  .catch(exception => {
    // see platform API docs for complete status codes list
    if (exception.code === FaceTecSDKStatus.CameraPermissionDenied) {
     // show some help how to allow camera access on his platform/device
    }
  })

Listening events

import FaceTec, { FaceTecUxEvent } from '@gooddollar/react-native-facetec';

// ...
// subscribe
const subscriptions = [
  FaceTec.sdk.addListener(FaceTecUxEvent.UI_READY, () => { /* facetec was initialized and its UI was shown */ })),
  FaceTec.sdk.addListener(FaceTecUxEvent.CAPTURE_DONE, () => { /* user has finished capturing has face and request being sent to the FaceTec Custom Server */ }),
  FaceTec.sdk.addListener(FaceTecUxEvent.FV_RETRY, () => { /* FaceTec is asking user to retry face capture process */ }),
]

// unsubscribe
for (unsubscribe of subscriptions) {
  unsubscribe()
}

Update SDKs

Android

  1. Goto https://dev.facetec.com/downloads
  2. Download Android SDK
  3. Remove ./android/libs/*.aar
  4. Copy ./facetec-sdk-9.X.YY.aar from android sdk archive to ./android/libs

Web

  1. Goto https://dev.facetec.com/downloads
  2. Download Browser SDK
  3. Remove ./web/sdk/FaceTecSDK.web.js ./web/sdk/images/*.png ./web/sdk/resources/*.* (keep folders)
  4. Copy ./core-sdk/FaceTecSDK.js/FaceTecSDK.js from browser sdk archive to ./web/sdk/FaceTecSDK.web.js (.web suffix is mandatory)
  5. Copy ``./core-sdk/FaceTecSDK.js/resources/.from browser sdk archive to./web/sdk/resources/`
  6. Copy ``./core-sdk/FaceTec_images/*.pngfrom browser sdk archive to./web/sdk/images/`