Skip to content

hyperverge/hyperkyc-sample-react-native

Repository files navigation

Integration steps to create workflow and start jamming :

Installation

HyperKyc npm plugin is available on npmjs - [react-native-hyperkyc-sdk](https://www.npmjs.com/package/react-native-hyperkyc-sdk)

Run the following command in your react-native project directory

npm install react-native-hyperkyc-sdk

Android Setup

  1. Make sure that the minimum SDK version is 21 or higher
  2. Enable multidex
  3. Open android/build.gradle file and add the following lines inside allprojects function
allprojects {
    repositories {
        google()
        mavenCentral()
        maven {
						url = "s3://hvsdk/android/releases"
            credentials(AwsCredentials) {
                accessKey = "aws_access_key" // get this from the team
                secretKey = "aws_secret_pass"// get this from the team
            }
        }
    }
}
  1. Sync the project

iOS Setup

  1. cd to iOS directory and run pod install
  2. Add Camera Permissions to request the user for camera permissions, add this key-value pair in your application's info.plist file.
    • Key : Privacy - Camera Usage Description
    • Value : "Access to camera is needed for document and face capture"

Integrate HyperKyc React Native SDK

  1. Create a workflow config dictionary in order to launch the HyperKYC SDK from react-native

    import { NativeModules } from 'react-native';
    const { Hyperkyc } = NativeModules
    
    // ...
    
       var configDictionary = {};
              configDictionary["appId"] = appID
              configDictionary["appKey"] = appKey
    											or 
              configDictionary["accessToken"] = accessToken
              <!-- configDictionary["defaultLangCode"] = "" -->
              
              var inputsDictionary = {};
              inputsDictionary["bvnNumber"] = "number-123"
              inputsDictionary["image"] = "image-path"
         
              
              configDictionary["inputs"] = inputsDictionary
              configDictionary["transactionId"] = transactionId
              configDictionary["workflowId"] = "workflow-id"

    In order to use the SDK, you can either use appId, appKey flow or the accessToken flow

    1. appId (appId) & appKey (appKey) Flow:

      • appKey
        • AppKey that is given to you in order to use the Hyperverge’s SDK
      • appId
        • AppID that is given to you in order to use the Hyperverge’s SDK.
    2. accessToken

      • accessToken can be generated by using this section
    3. transactionId (Mandatory)

      • The transactionId that has to be used when the SDK tries to create an user session for every KYC flow.
      1. workflowId (Mandatory)
  • The workflowId that is used to fetch the custom workflow config for the appId. This can be obtained from Hyperverge Dashboard.
  1. Launch HyperKyc

    //  Launch HyperKyc using launch() function
         Hyperkyc.launch(configDictionary, function(result){
                   console.log(result)
               })
    
    
✌🏻 Voila 🥳 That’s it. Done.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published