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 🙏

© 2026 – Pkg Stats / Ryan Hefner

liveness-rn

v1.1.11

Published

My Liveness Library

Downloads

155

Readme

liveness-rn

Liveness - React Native

Request

  • Minimum iOS Deployment Target: 13.0
  • Xcode 14 or newer
  • Swift 5
  • Android minSdkVersion: 24
  • Android compileSdkVersion: 33
  • Android targetSdkVersion: 33
  • React Native version < 0.73

Installation

package.json

"dependencies": {
    "liveness-rn": "https://github.com/Techainer/rn-sdk.git#{tag_version}",
}

or

"dependencies": {
    "liveness-rn": "file://{path_to_folder_clone}/rn-sdk",
}

Manually Installation

Android

  1. In root android's project -> add to build.gradle
repositories {
    google()
    mavenCentral()
    maven { url 'https://jitpack.io' }
    
}

add to dependencies

    implementation("com.facebook.react:react-android")
    implementation('androidx.appcompat:appcompat:1.4.1')
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'

    implementation('com.google.mlkit:face-detection:16.1.5')
    implementation('com.otaliastudios:cameraview:2.7.2')
    implementation('org.bouncycastle:bcpkix-jdk18on:1.73')
    implementation('com.nimbusds:nimbus-jose-jwt:9.31')
    implementation('commons-codec:commons-codec:1.16.0')

compileOptions

compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
    }

gradle version

    classpath com.android.tools.build:gradle:7.2.1
    classpath org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version

IOS

After pod installation is complete

Add permissions in Info.plist

<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSAllowsArbitraryLoads</key>
		<false/>
		<key>NSAllowsLocalNetworking</key>
		<true/>
	</dict>
	<key>NSCameraUsageDescription</key>
	<string>Use to scan QR code and take photos of user&apos;s certificate and uses the camera to read passports</string>
	<key>NSLocationWhenInUseUsageDescription</key>
	<string></string>
	<key>NSMicrophoneUsageDescription</key>
	<string>The application does not use this feature</string>
	<key>NSPhotoLibraryAddUsageDescription</key>
	<string>The application does not use this feature</string>
	<key>NSPhotoLibraryUsageDescription</key>
	<string>The application does not use this feature</string>
	<key>NSDocumentsDirectory</key>
	<string>The application does not use this feature</string>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>arm64</string>
	</array>

add Podfile

add library

  <!-- pod 'QTSCardReader' ,:git => 'https://github.com/trungnguyen1791/QTSCardReader.git'
  pod 'SVProgressHUD'
  pod 'Alamofire', '5.8.1'
  pod 'QTSLiveness'
  pod 'FlashLiveness', :git => 'https://github.com/stevienguyen1988/FlashLivenessPod.git'
    use_frameworks!
    ***
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
    end
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
         if config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f < 12.0
           config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
         end
      end
  end

React native

All ways to use the sdk have been detailed as examples in the sample folder
path example/src/App.js

Out when liveness success

Call back check isFlash

Khởi tạo đang là loại camera nào: data.nativeEvent?.data?.isFlash

Sdk flash

Trả về 2 ảnh:

  • Ảnh ám màu liveness (base64): data.nativeEvent?.data?.livenessColorImage
  • Ảnh thường (base64): data.nativeEvent?.data?.livenessOriginalImage
  • color kiểu string ngẫu nhiểu trong các ký tự (r, g, b): data.nativeEvent?.data?.color

=> + Lưu ý màn livenesss style nên để widht: 100%, height: Platform.OS == 'android' ? windowWidth * 1.7 : '100%'

  • Để khung hình camera vào giữa màn hình

Sdk 3D

Trả về 2 ảnh:

  • Ảnh thường (base64): data.nativeEvent?.data?.livenessOriginalImage
  • Ảnh ảnh nhiệt (base64): data.nativeEvent?.data?.livenessThermalImage
  • Vertor là mảng float (2 giá trị vector): data.nativeEvent?.data?.livenessImage?.vector

Chỉ sử dụng cho Iphone x trở nên. Trường hợp nếu 10s sử dụng 3D không nhận được response trả về sẽ tự động chuyển sang Sdk flash

Trường chuyển đổi giữa Flash và 3D là isFlashCamera

isFlashCamera = true --> Sử dụng sdk flash isFlashCamera = false --> Sử dụng sdk 3D debugging = false --> bắt buộc, chuyển thành true nếu cần để test

onEvent={(data) => {
  console.log('===sendEvent===', data.nativeEvent?.data);
  if (data.nativeEvent?.data?.livenessImage != null || data.nativeEvent?.data?.livenessOriginalImage != null) {
    if (isIphoneX && isFlashCamera) {
      onCheckFaceId(data.nativeEvent?.data?.livenessOriginalImage, data.nativeEvent?.data?.livenessImage);
      setIsFlashCamera(false)
    } else {
      onCheckFaceId(data.nativeEvent?.data?.livenessImage);
    }
  }
}}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library