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

paperstack

v1.0.25

Published

This package is for generating OTP with the provider handling the validity and storage of the OTP. This is developed as for a study with the use of QR code with OTPs for improved security. For any questions and suggestions feel free to send an email to [a

Downloads

29

Readme

Developer's Note

This package is for generating OTP with the provider handling the validity and storage of the OTP. This is developed as for a study with the use of QR code with OTPs for improved security. For any questions and suggestions feel free to send an email to [email protected].


Getting Started

Installation of the Package

npm install paperstack

or

yarn add paperstack

CDN

Not yet implemented

Usage

const paperstack = require('paperstack')
#or
import paperstack from 'paperstack' //Using ES6

Initialization

An account is needed to be able to use this package (Don't worry, this package is free and no costs are expected down the line). Avoid storing your credentials directly in variable. We recommend storing them in the ENV and access them through process.ENV.variable_name. Sign up here. Create a separate file to for the package initialization and call init().

const paperstack = require('paperstack')

const client = new paperstack(email, password, clientSecret, clientID)
client.init()
module.exports = client

Schema 1

A simple OTP schema with the OTP in QR option. Generates raw OTP which can be accessed in the object. | Parameter | Type | Required | Default Value | Description | | ----------- | ----------- | ----------- | ----------- | ----------- | |uniqueId|string|true||A unique ID which will be used later as reference for verification of OTP|

This will return an object containing the OTP and a base64 string that can be rendered to an image which contains the raw OTP.

client.verifyOTP(id, otp)

OTP verification

| Parameter | Type | Required | Default Value | Description | ----------- | ----------- | ----------- | ----------- | ----------- | |id|string|true||A unique ID for a valid generator| |OTP|string|true||OTP user input|

OTP verification. Returns a bool. This can be used with either of the 2 schemas

const QR = client.upsertUser(uniqueID)

Schema 2

OTP schema where the user can generate OTP for himself/herself when logging in.

Create OTP Generator Generator is valid for a limited amount of time generation can only be allowed by the developer(Ideally called upon login attempt).

| Parameter | Type | Required | Default Value | Description | ----------- | ----------- | ----------- | ----------- | ----------- | |id|string|true| |A unique ID which will be used later as reference for verification of OTP| |expiry|numbe|true| |Duration of the OTP generator validity in seconds(Roughly 86400 seconds a day).|

Creates an OTP generator. Returns a link that is valid within the Expiry's duration. It is advised for the user to save the QR code instead of the link.

client.createOTPGenerator(id, expiry)

Allow OTP generation of valid generator

| Parameter | Type | Required | Default Value | Description | ----------- | ----------- | ----------- | ----------- | ----------- | |id|string|true| |A unique ID for a valid generator|

Allows the valid generator to generate OTPs using the generator link. Valid for only 5 minutes

client.allowGenerateOTP(id)

Check user status using ID

| Parameter | Type | Required | Default Value | Description | ----------- | ----------- | ----------- | ----------- | ----------- | |id|string|true||A unique ID used earlier to generate and OTP or create a Generator|

Returns an object contaning the current status and details linked to an ID.

client.checkUserStatus(id)

Read more about the documentation at Paperstack documentation