# koajs/jwt

Koa middleware for validating JSON Web Tokens

Repository: https://github.com/koajs/jwt
Canonical: https://ross.abutalabs.com/products/koajs-jwt
Language: JavaScript
License: MIT
License Family: permissive
Last push: 2024-09-10T02:34:25+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4599, "days_push": 723, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1350, forks 121 (observed 2026-08-28T04:04:28.075951+00:00)

## What it is
koa-jwt is a Koa middleware for authenticating HTTP requests using JSON Web Tokens. It validates JWTs from headers or cookies and exposes the decoded payload to downstream middleware for authorization.

## Use cases
- add jwt authentication to a koa api
- validate bearer tokens in node.js http requests
- protect koa routes with token auth
- read jwt from a cookie in koa
- set authenticated user on request state for authorization

## When to choose
- your app is built on Koa and you need standard JWT bearer/cookie authentication
- you want a small, focused middleware rather than a full auth framework
- you need token revocation checks and custom secret handling

## When to avoid
- you use Express or Fastify rather than Koa
- you need full identity management with sessions, OAuth, or user registration
- you need non-JWT auth schemes like basic auth or SAML

## Facets
- artifact type: library
- maturity: stable
- function: auth, middleware, http-server
- domain: web-development, backend, security, apis
- platform: -
- tags: jwt, koa, authentication, token-validation, expressjs-alternative, nodejs, web-server

## Member repositories
- koajs/jwt (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:28.075951+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:42:17.667961+00:00, confidence not recorded.
  - readme: https://github.com/koajs/jwt (fetched 2026-08-28T04:04:28.075951+00:00, sha e9e52051ecc3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
