Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastify-jwt

Package Overview
Dependencies
Maintainers
5
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-jwt

JWT utils for Fastify

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.8K
decreased by-4.91%
Maintainers
5
Weekly downloads
 
Created
Source

fastify-jwt

js-standard-style Build Status

JWT utils for Fastify, internally uses jsonwebtoken.

Install

npm i fastify-jwt --save

Usage

Register it as plugin and then access it via jwt.
The api is the same of jsonwebtoken, refer to their documentation to find how use the utilities.

const fastify = require('fastify')
fastify.register(require('fastify-jwt'), { secret: 'supersecret' }, err => {
  if (err) throw err
})

fastify.post('/signup', (req, reply) => {
  // some code
  const token = fastify.jwt.sign({ payload })
  reply.send({ token })
})

fastify.listen(3000, err => {
  if (err) throw err
})

Acknowledgements

This project is kindly sponsored by:

  • LetzDoIt

License

Licensed under MIT.

Keywords

FAQs

Package last updated on 23 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc