JWT Core
You can simply use jwt
This project was created to make using jsonwebtoken
easier.
Most features can be used the same as jsonwebtoken
Install
$ npm i jwt-core
Usage
Create Token By Payload
const jwt = const token = payload;
payload
is samejsonwebtoken
you also use create method
const jwt = const token = jwtToken;
payload
is samejsonwebtoken
Create Token By Aliased Payload
const jwt = const token = jwtToken;
-
you can use claim key by aliased key
issuer: 'iss'subject: 'sub'audience: 'aud'expiresIn: 'exp'notBefore: 'nbf'issuedAt: 'iat'jwtId: 'jti' -
payload
is samejsonwebtoken
Create Token By Encoding Token
const jwt = const token = jwtToken;
options
is samejsonwebtoken
Encode Token
token;
options
is samejsonwebtoken
Get And Set Token Claim
Get
token;
- Alias is applied
Set
token;
- Alias is applied