{"library":"restify-jwt-community","title":"restify-jwt-community","description":"JWT authentication middleware for Restify, current stable version 2.0.0 (released 2023-03-27). This community-maintained fork validates JSON Web Tokens and sets req.user on incoming requests. It builds on auth0/express-jwt and the original restify-jwt, but uses restify's built-in error objects. Maintenance cadence is low (last release v2.0.0, prior updates were mostly lockfile maintenance). Compared to express-jwt, this is tailored specifically for Restify and uses restify errors.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install restify-jwt-community"],"cli":null},"imports":["import jwt from 'restify-jwt-community'","const jwt = require('restify-jwt-community')","import { UnauthorizedError } from 'restify-jwt-community'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import restify from 'restify';\nimport jwt from 'restify-jwt-community';\n\nconst server = restify.createServer();\n\nserver.use(restify.plugins.bodyParser());\nserver.use(jwt({ secret: process.env.JWT_SECRET || 'your-secret-key' }));\n\nserver.get('/protected', (req, res, next) => {\n  res.send(200, { user: req.user });\n  return next();\n});\n\nserver.listen(3000, () => {\n  console.log('Server listening on port 3000');\n});","lang":"typescript","description":"Basic setup of Restify server with JWT middleware for a protected route.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}