# middyjs/middy

🛵 The stylish Node.js middleware engine for AWS Lambda 🛵

Repository: https://github.com/middyjs/middy
Canonical: https://ross.abutalabs.com/products/middy
Homepage: https://middy.js.org
Language: JavaScript
License: MIT
License Family: permissive
Topics: serverless, aws, aws-lambda, framework, middleware, lambda-handler, lambda, nodejs, javascript, typescript, middy, node, serverless-framework, aws-serverless, serverless-applications, serverless-express, powertools, aws-powertools
Last push: 2026-08-26T22:03:01+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 86, longevity 100
- inputs: {"age_days": 3317, "days_push": 7, "days_rel": 14, "gap_med": 3.0, "n_releases_24m": 63}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3903, forks 398 (observed 2026-08-28T04:08:28.638515+00:00)

## What it is
Middy is a Node.js middleware engine for AWS Lambda that lets developers attach modular, reusable middlewares (before/after/onError phases) around their Lambda handlers. It bundles a small core with many official middlewares for parsing, validation, auth, secrets fetching, observability, and error handling.

## Use cases
- parse JSON bodies in Lambda API Gateway handlers
- validate Lambda event and response payloads with JSON Schema
- verify JWTs on incoming HTTP requests in Lambda
- fetch secrets from Secrets Manager or SSM in Lambda handlers
- add CORS and security headers to Lambda HTTP responses
- log Lambda input/output and errors for observability
- reduce boilerplate in serverless Lambda functions

## When to choose
- you write AWS Lambda functions in Node.js and want clean separation of business logic from cross-cutting concerns
- you want off-the-shelf middlewares for API Gateway, JWT auth, validation, and AWS secrets
- cold-start size and performance matter and you want a minimal, opt-in middleware core

## When to avoid
- your Lambda functions are in Python, Go, or another non-Node.js runtime
- you run Express or another full web server rather than Lambda handlers
- you need a general-purpose web framework with routing rather than a middleware engine

## Facets
- artifact type: framework
- maturity: stable
- function: middleware, web-framework, form-handling, serialization, logging, auth, caching
- domain: cloud-computing, backend, developer-tools, apis
- platform: serverless, cloud
- tags: aws-lambda, middleware-engine, serverless-framework, cold-start, jwt, secrets-manager, ssm, api-gateway, serverless, nodejs

## Member repositories
- middyjs/middy (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:28.638515+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-29T18:25:09.789935+00:00, confidence not recorded.
  - readme: https://github.com/middyjs/middy (fetched 2026-08-28T04:08:28.638515+00:00, sha 48701a158370)
  - homepage: https://middy.js.org (fetched 2026-08-29T09:19:39.471263+00:00, sha d9f270ffc650)
  - site_page: https://middy.js.org/docs (fetched 2026-08-29T09:19:39.480966+00:00, sha 3fe16de052f9)
  - site_page: https://middy.js.org/docs/middlewares/intro (fetched 2026-08-29T09:19:39.482955+00:00, sha 1b7bbd99aef2)
  - site_page: https://middy.js.org/docs/events/intro (fetched 2026-08-29T09:19:39.484764+00:00, sha 55d616740ea2)
  - site_page: https://middy.js.org/docs/intro/utilities (fetched 2026-08-29T09:19:39.486377+00:00, sha af92e3ca942e)
  - site_page: https://middy.js.org/docs/writing-middlewares/intro (fetched 2026-08-29T09:19:39.487913+00:00, sha 94bb0aee5041)
  - site_page: https://middy.js.org/docs/intro/hooks (fetched 2026-08-29T09:19:39.489708+00:00, sha 9a8340d6f6db)
  - site_page: https://middy.js.org/docs/events/api-gateway-http (fetched 2026-08-29T09:19:39.491398+00:00, sha 3e09e080774a)
  - site_page: https://middy.js.org/docs/events/api-gateway-rest (fetched 2026-08-29T09:19:39.493149+00:00, sha b04853ec2188)
- Data as of 2026-08-30T08:39:29.467469+00:00.
