1.0.7 • Published 4 months ago

kyc-sdk-react-native v1.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

kyc-sdk-react-native

A React Native SDK for handling KYC authentication, updates, and password management.

Installation

Install the package using npm:

npm i kyc-sdk-react-native

Importing the Package

Import the package in your React Native project:

import AcidCheck from "kyc-sdk-react-native";

Usage

Setting Up the Component

import React, { useRef, useState } from "react";
import AcidCheck from "kyc-sdk-react-native";

const MyKYCComponent = () => {
  const allRef = useRef<any>(null); // Create a reference

  const [initializingData, setInitializingData] = useState({
    acid: "", // User identifier
    email: "", // User email
    url: "", // API endpoint
    channel: "", // Communication channel
  });

  const handleAuthenticate = () => {
    if (allRef.current) {
      allRef.current.handleAuthenticateKYC(); // Calls authentication function
    }
  };

  const handleUpdate = () => {
    if (allRef.current) {
      allRef.current.handleUpdateKYC(); // Calls update function
    }
  };

  const handleChangePassword = () => {
    if (allRef.current) {
      allRef.current.changePassword(); // Calls change password function
    }
  };

  const handleResetPassword = () => {
    if (allRef.current) {
      allRef.current.resetPassword(); // Calls reset password function
    }
  };

  return <AcidCheck ref={allRef} initializingData={initializingData} />;
};

export default MyKYCComponent;

API Methods

The AcidCheck component provides the following methods that can be accessed via useRef:

  • handleAuthenticateKYC(): Initiates KYC authentication.
  • handleUpdateKYC(): Updates user KYC information.
  • changePassword(): Triggers a password change process.
  • resetPassword(): Triggers a password reset process.

Props

initializingData (object)

An object containing the following properties:

PropertyTypeDescription
acidstringUser identifier
emailstringUser email
urlstringAPI endpoint
channelstringCommunication channel

License

This package is licensed under MIT.