README
react-native-andia-biometric
Android wrapper for Andia selfie SDK
Installation
Install the npm package
npm install react-native-andia-biometric
or
yarn add react-native-andia-biometric
Usage
First, import the module:
import BiometricAndia from 'react-native-andia-biometric';
Then, launch the sdk by using the following method:
BiometricAndia.startSDK(params, successCallback, errorCallback);
where:
params:
- apiKey: (string, Your customer API_KEY) required
- action: (string, "onboarding" or "validation") required
- userId: Mandatory in the validation process, this userId is returned in the onboarding of a specific user. Then when a Selfie validation is required, this is the way to validate a user against her userId. This parameter is empty when we call an onboarding a new user.
successCallback: Success callback function.
errorCallback: Error callback function.
Example - Onboarding
const successResponse = (result: any) => {
console.log(result.message);
setUserId(result.userId);
};
const errorResponse = (result: any) => {
console.log(result.message);
};
const params = {
action: 'onboarding',
apiKey: API_KEY,
};
BiometricAndia.startSDK(params, successResponse, errorResponse);
Example - Validation
const successResponse = (result: any) => {
console.log(result.message);
setIsMatch(result.isMatch);
};
const errorResponse = (result: any) => {
console.log(result.message);
};
const params = {
action: 'validation',
apiKey: API_KEY,
userId: '999', //is returned in the onboarding
};
BiometricAndia.startSDK(params, successResponse, errorResponse);
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT