@blusalt-sdk/react-native-full-identity-library
v0.1.6
Published
Document Verification and Liveness SDK
Downloads
27
Readme
react-native-full-identity-library
Document Verification and Liveness SDK
Installation
npm install react-native-full-identity-library
Android Setup
#Create a github.properties file in the root folder of android. Path should be like below: E.g. "myReactApp/android/github.properties"
# Add the following in github.properties:
USERNAME_GITHUB=MyUsernameOnGithub
TOKEN_GITHUB=TokenFromGithubClassicToken
Usage
import {
startDocumentAbsentSDK,
startSDKWithIdNumberSDK,
startSDKWithCustomSelector,
DocumentType,LivenessType
} from '@blusalt-sdk/react-native-blusalt-document-verification';
// ...
const clientId = "";
const appName = "";
const apiKey = "";
const isDev: boolean = false;
const idNumber = "1212121212";
startWithoutIdNumber = () => {
startDocumentAbsentSDK(clientId, appName, apiKey, isDev, LivenessType.motional, threshold, timeoutDurationInSec, (responseJson) => {
console.log(responseJson);
});
};
startWithIdNumber = () => {
startSDKWithIdNumberSDK(clientId, appName, apiKey, isDev, DocumentType.bvn, idNumber, LivenessType.motional, threshold, timeoutDurationInSec, (responseJson) => {
console.log(responseJson);
});
};
startUsingCustomSelector = () => {
startSDKWithCustomSelector(clientId, appName, apiKey, isDev, [DocumentType.selector, DocumentType.driverLicense], LivenessType.still, threshold, timeoutDurationInSec, (responseJson) => {
console.log(responseJson);
});
};
Android Setup
Android
Step 1
Create a [github.properties] file in root of android folder and put below into content. E.g. "myReactApp/android/github.properties" Replace values with your github credentials from github and make sure to grant necessary permissions especially for github packages
USERNAME_GITHUB=SampleUsername
TOKEN_GITHUB=SampleClassicToken
Step 2
Add below to project level gradle file /android/build.gradle
buildscript {
ext.kotlin_version = '1.9.+'
...
dependencies {
classpath 'com.android.tools.build:gradle:7.3.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
def githubPropertiesFile = rootProject.file("github.properties")
def githubProperties = new Properties()
githubProperties.load(new FileInputStream(githubPropertiesFile))
repositories {
maven {
name "GitHubPackages"
url 'https://maven.pkg.github.com/Blusalt-FS/Full-Identity-SDK-Android'
credentials {
username githubProperties['USERNAME_GITHUB']
password githubProperties['TOKEN_GITHUB']
}
}
maven {
name "GitHubPackages"
url 'https://maven.pkg.github.com/Blusalt-FS/Liveness-Only-Android-Package'
credentials {
username githubProperties['USERNAME_GITHUB']
password githubProperties['TOKEN_GITHUB']
}
}
maven {
name "GitHubPackages"
url 'https://maven.pkg.github.com/Blusalt-FS/Blusalt_Document_Verification-Android-Package'
credentials {
username githubProperties['USERNAME_GITHUB']
password githubProperties['TOKEN_GITHUB']
}
}
}
}
Step 3
Change the minimum Android sdk version to 24 (or higher) in your /android/app/build.gradle
file.
android {
...
defaultConfig {
...
minSdkVersion 24
}
...
}
Step 4
If you're experiencing crashes or timeouts.
Add below to your progaurd.pro file if using progaurd or minify is enabled /android/app/proguard-rules.pro
-keep class net.blusalt.liveness_native.** { *; }
-keep class net.blusalt.identityverify.Core.** { *; }
-keep public class com.megvii.**{*;}
Enable proguard in /android/app/build.gradle
file like below.
android {
...
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
...
}
IOS Setup
Add below to your info.plist file to request camera permission /ios/${AppFolder}/info.plist
<key>NSCameraUsageDescription</key>
<string>Blusalt Reactnative Liveness requires camera for liveness</string>
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