npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pavelon-enhanced-kyc

v0.1.0

Published

Pavelon EnhanceKyc

Downloads

1

Readme

Installation

yarn add pavelon-enhanced-kyc

Usage

import EnhancedKyc from 'pavelon-enhanced-kyc';

const enhanced = new EnhancedKyc({
  senderId?: string  //required for phone verification
  privateKey: string
  accessKey:string
  appId: string
  domainId: string
  otpLength?: string
})

The onSend() function is an asynchronous function that sends an OTP (One Time Password) to a specified phone number using the enhanced.send_verification_code() method. It takes a phonenumber parameter as its input, which is passed as the phone property to the enhanced.phonenumber() method.


  async function onSend() {
    try {
      const response = await enhanced.send_verification_code({ phonenumber: '<string>' });
        //handle successful sent code here
      
      console.log(response);
      
    } catch (error) {
     //handle error here
     
      console.log(error);
    }
  }
  

Define the verify_verification_code Method: Assume enhanced is an instance of a class that has the verify_verification_code method. This method is expected to take an object with code and phonenumber properties and return a Promise that resolves with the response.


  async function onVerify() {
    try {
      const response = await enhanced.verify_verification_code({ code: '<string>', phonenumber: '<string>' });
    // handle successful verification here
      
      console.log(response);
      
    } catch (error) {
     //handle error here
     
      console.log(error);
    }
  }
  

The handleGhanCardVerification function is an asynchronous function designed to verify Ghana card details by calling the ghana_card_verification method from the enhanced object. It handles both the success and failure cases of the verification process.


async function handleGhanCardVerification () {

  try {
    // Make an API call to verify the Ghana card details
    const response = await enhanced.ghana_card_verification({
      firstName: "<string>",       // The first name of the cardholder
      middleName: "<string>",      // The middle name of the cardholder
      lastName: "<string>",        // The last name of the cardholder
      idNumber: "<string>",        // The ID number on the Ghana card
      dateOfBirth: "<string>",     // The date of birth of the cardholder
      frontImage: "File",          // The file representing the front image of the Ghana card
      backImage: "File",           // The file representing the back image of the Ghana card
      userId: "<string>",          // The user ID associated with the verification request
      referenceNumber: "<string>"  // A reference number for the verification process
    });
    // handle successful verification here
    
    console.log(response);
    
  } catch(error) {
    // handle errors here
    
    console.error(error);
  
  }
};