numio-cdn
TypeScript icon, indicating that this package has built-in type declarations

1.0.10 • Public • Published

NUMIO-CDN

A package for using numio service for authentication purpose. This package is used on front-end, you also need to install numio-sdk on your back-end to complete the process of authentication with numio.

Installation

To install using npm :

npm install numio-cdn

To install using Yarn :

yarn add numio-cdn

Getting Started

You have to get yourself registered on numio to start using it's authtication services. After registration you will get "APP_ID" and "APP_SECRET" which you will be using in your code to get started.

Example of Login With Numio

import React, {useState, useEffect} from "react;
import numio from "numio-cdn";
import SomeQrComponent from "some-qr-render" //example package for render QR

const MyComponent = () => {
    const [url,setUrl] = useState("");

    useEffect(()=>{
        getUrlFromNumio();
    },[])

    const getUrlFromNumio = async () => {
        try{
            const numioCDN = new numio({app_id: "APP_ID"}); //provide APP_ID you got after registration on numio.
            const res = await numioCDN.getUrlForLogin();
            setUrl(res);
            numioCDN.call(async(token) => {
                console.log(token); //you get token here which you will use to authenticate the user from numio-sdk package
            })
        }
        catch(e){
            console.log(e)
        }
    }

    return(
        <SomeQrComponent
        value={url}
        />
    )
}

Example of KYC With Numio

import React, {useState, useEffect} from "react;
import numio from "numio-cdn";
import SomeQrComponent from "some-qr-render" //example package for render QR

const MyComponent = () => {
    const [url,setUrl] = useState("");

    useEffect(()=>{
        getUrlFromNumio();
    },[])

    const getUrlFromNumio = async () => {
        try{
            const numioCDN = new numio({app_id: "APP_ID"}); //provide APP_ID you got after registration on numio.
            const res = await numioCDN.getUrlForKyc();
            setUrl(res);
        }
        catch(e){
            console.log(e)
        }
    }

    return(
        <SomeQrComponent
        value={url}
        />
    )
}

Readme

Keywords

none

Package Sidebar

Install

npm i numio-cdn

Weekly Downloads

0

Version

1.0.10

License

ISC

Unpacked Size

16.1 kB

Total Files

6

Last publish

Collaborators

  • khuzama98
  • xord.one
  • devleed