Fetch Middleware for OAuth2

JSON →
library 1.0.2 ·javascript maintenance
verified May 27, 2026

fetch-mw-oauth2 is a JavaScript library designed to simplify OAuth2 integration with the standard `fetch` API, handling automatic token acquisition and refreshing. Currently at v3.3.1, it supports `authorization_code`, `password`, and `client_credentials` grant types, offers robust error handling, OpenID Connect `id_token` exposure, and includes support for token revocation (RFC 7009) and the `resource` parameter (RFC 8707). Since its v3.0.0 release, the library is ESM-only and has ceased support for Node.js 14 and 16. It primarily functions as a `fetch` wrapper or middleware. This package is in maintenance mode, as development has shifted to its successor, `@badgateway/oauth2-client`, which offers enhanced features and similar functionality.

total hits 36
actors 8 distinct systems
last hit 1d ago ByteDance
Amazonbot
4
MetaBot
4
GPTBot
2
ByteDance
2
Script
1
Search engines
2
Humans
3

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇸🇬 Singapore · 🇩🇪 Germany · 🇪🇸 Spain