react-native-hyperkyc-sdk
v2.4.0
Published
React Native wrapper for HyperKYC SDK
Readme
react-native-hyperkyc-sdk
React Native wrapper for HyperKYC SDK
Installation
npm install react-native-hyperkyc-sdkUsage
import { NativeModules } from 'react-native';
const { Hyperkyc } = NativeModules
// ...
var configDictionary = {};
configDictionary["appId"] = appID
configDictionary["appKey"] = appKey
var inputsDictionary = {};
inputsDictionary["bvnNumber"] = "number-123"
inputsDictionary["image"] = "image-path"
// configDictionary["defaultLangCode"] = "vn"
configDictionary["inputs"] = inputsDictionary
configDictionary["transactionId"] = transactionId
configDictionary["workflowId"] = "<workflow-id>"
// Generate unique ID
Hyperkyc.createUniqueId(uniqueId =>{
console.log(uniqueId)
configDictionary["uniqueId"] = uniqueId;
});
//Prefetch configs
Hyperkyc.prefetch(appID, workflowID)
// [Recommended] Attach event listeners before launching HyperKYC SDK
HyperKyc.addEventListener((event) => {
// Handle the step_ended event
});
// [Recommended] Remove all event listeners after receiving the SDK response from HyperKYC SDK
HyperKyc.removeAllEventListeners();
Hyperkyc.launch(configDictionary, function(response){
console.log(response)
})Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
