0.4.3 • Published 3 years ago

jwt-giveaway v0.4.3

Weekly downloads
11
License
MIT
Repository
-
Last release
3 years ago

JWT Giveaway

Node program for running a giveaway through the use of JSON Web Tokens (jwt). Each participant that enters will receive a JWT. They can decode this token at jwt.io to determine if they are a winner.

Usage

const JWTGiveaway = require('jwt-giveaway');
const giveaway = new JWTGiveaway(1); //create giveaway where 1 represents the number of winners
giveaway.start(); //starts the giveaway and accepting entries
giveaway.enter("<USERNAME>"); //enters the username into the giveaway
const {err, data : { userToTokenMap } } = giveaway.stop(); //stops the giveaways and returns a map of username entries to JWTs
const {err, data: { msg } } = giveaway.checkForWinner("<USERNAME>", "<TOKEN>") //validates whether or not the token is valid for the given usernameå
0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago