{"library":"koa-jwt","type":"library","category":null,"description":"koa-jwt is a middleware for Koa.js applications designed to authenticate HTTP requests using JSON Web Tokens (JWTs). It parses and validates JWTs typically provided in the `Authorization` header, or optionally from a cookie or a custom `getToken` function. Upon successful validation, the decoded JWT payload is exposed on `ctx.state.user` (by default) for subsequent middleware to use for authorization and access control. The current stable version is 4.0.4. Releases are driven by dependency updates (especially `jsonwebtoken`) and bug fixes, with major versions tied to Node.js support or significant internal changes. It differentiates itself by providing a streamlined, Koa-idiomatic approach to JWT authentication, leveraging Koa's async/await middleware pattern, and integrates well with `koa-unless` for path-based exclusion. It supports single or multiple secrets, including rolling secrets or mixed authentication methods (e.g., Auth0 PEM files and shared secrets).","language":"javascript","status":"active","version":"4.0.4","tags":["javascript","auth","authn","authentication","authz","authorization","http","jwt","json","typescript"],"last_verified":"Wed May 27","install":[{"cmd":"npm install koa-jwt","imports":["import jwt from 'koa-jwt';","import type { Options } from 'koa-jwt';","import type { Context } from 'koa'; // ... and koa-jwt adds ctx.state.user"]},{"cmd":"yarn add koa-jwt","imports":[]},{"cmd":"pnpm add koa-jwt","imports":[]}],"homepage":null,"github":"https://github.com/koajs/jwt","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/koa-jwt","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/koa-jwt/compatibility"}}