Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 8, 2024 via pnpm

jsonwebtoken 9.0.2

JSON Web Token implementation (symmetric and asymmetric)
Package summary
Share
0
issues
4
licenses
12
MIT
1
BSD-3-Clause
1
Apache-2.0
1
ISC
Package created
1 Jul 2013
Version published
30 Aug 2023
Maintainers
3
Total deps
15
Direct deps
10
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
12 Packages, Including:
jsonwebtoken@9.0.2
jwa@1.4.1
jws@3.2.2
lodash.includes@4.3.0
lodash.isboolean@3.0.3
lodash.isinteger@4.0.4
lodash.isnumber@3.0.3
lodash.isplainobject@4.0.6
lodash.isstring@4.0.1
lodash.once@4.1.1
ms@2.1.3
safe-buffer@5.2.1

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
buffer-equal-constant-time@1.0.1

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
ecdsa-sig-formatter@1.0.11

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
semver@7.6.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

10
All Dependencies CSV
β“˜ This is a list of jsonwebtoken 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
jws3.2.25.75 kBMIT
prod
lodash.includes4.3.06.05 kBMIT
prod
lodash.isboolean3.0.32.06 kBMIT
prod
lodash.isinteger4.0.43.38 kBMIT
prod
lodash.isnumber3.0.32.14 kBMIT
prod
lodash.isplainobject4.0.62.96 kBMIT
prod
lodash.isstring4.0.12.13 kBMIT
prod
lodash.once4.1.13.81 kBMIT
prod
ms2.1.32.9 kBMIT
prod
semver7.6.193.27 kBISC
prod

Visualizations

Frequently Asked Questions

What does jsonwebtoken do?

jsonwebtoken is a reliable JavaScript library that implements JSON Web Tokens (JWTs). JWT is a standard way to create access tokens with detailed explicit claims that are securely encrypted with a private and/or public key. The tokens are used mainly for authentication and secure information exchange.

How do you use jsonwebtoken?

To make use of jsonwebtoken, you first need to install it through npm with the command npm install jsonwebtoken. Once installed, you can require the library in your JavaScript code with var jwt = require('jsonwebtoken');.

Creating JWTs requires the sign method, which creates a new token with a specific payload and secret. Here is a simple demonstration of its usage:

var jwt = require('jsonwebtoken');
var token = jwt.sign({ foo: 'bar' }, 'shhhhh');

In this instance, { foo: 'bar' } is the payload and 'shhhhh' stands as the secret. The sign method will return a token string.

To verify the integrity of the token, jsonwebtoken provides the verify function which checks if the token is valid using a secret or a public key. If successful, a decoded payload is returned. A failure will throw an error.

var decodedPayload = jwt.verify(token, 'shhhhh');
console.log(decodedPayload.foo) // Outputs: bar

In the above example, the verify method accepts several options for doing things like checking the issuer, verifying correct audience, or checking token lifespan.

Where are the jsonwebtoken docs?

The jsonwebtoken documentation, including more detailed instructions and usage examples, is available on their GitHub repository at https://github.com/auth0/node-jsonwebtoken.