numio-sdk
Version:
This package is for using Numio 2Fa service, it's used on the back-end.
46 lines (34 loc) • 1.24 kB
Markdown
# NUMIO-SDK
<p>
A package for using numio service for authentication purpose. This package is used on back-end, you also need to install numio-cdn on your front-end to complete the process of authentication with numio.
</p>
# Installation
To install using npm :
```
npm install numio-sdk
````
To install using Yarn :
```
yarn add numio-sdk
```
## Getting Started
You have to get yourself registered on numio to start using it's authentication services. After registration you will get "APP_ID" and "APP_SECRET" which you will be using in your code to get started.
### Example
```
import numio from "numio-sdk";
const customRouteToVerifyUser = async (req,res) => {
try{
const {token} = req.body;
const data = {
token,
app_secret: "APP_SECRET" //write your APP_SECRET here.
userDetails: ["fullname", "email", "profileImage", "numio_id] //you're telling that what user information you want in return if user is successfully authenticated.
}
const isUserVerfied = await numio.verifyToken(data);
//you will get response in "isUserVerified" variable, whether user is authenicated successfully or not.
}
catch(e){
//throw error
}
}
```