# jwks-rsa

> Library to retrieve RSA public keys from a JWKS endpoint

Latest version **4.1.0** (published 2026-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install jwks-rsa
pnpm add jwks-rsa
yarn add jwks-rsa
bun add jwks-rsa
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2026-06-19 |
| First published | 2016-07-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^20.19.0 \|\| ^22.12.0 \|\| >= 23.0.0 |
| Dependencies | 6 |
| Unpacked size | 31.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 875 |
| Author | Auth0 |
| Maintainers | auth0-oss, auth0npm, auth0brokkr, jessele, oktajeffoktajeff, bsmith-auth0, sanjay.manikandhan, niltorresatko, henry.mcardle, nicolas.villalobos, adam-mcgrath_okta, josecarlos-chavez_atko, tj.okta, sgarcia-atko, roger.chan, maaantone, lewisbyrne-okta, tarunpreet.kaur |
| Keywords | jwks, rsa, jwt |

## Links

- npm: https://www.npmjs.com/package/jwks-rsa
- Repository: https://github.com/auth0/node-jwks-rsa
- Homepage: https://github.com/auth0/node-jwks-rsa#readme
- Issues: https://github.com/auth0/node-jwks-rsa/issues
- npm.io page: https://npm.io/package/jwks-rsa

## Dependencies (6)

- [jose](https://npm.io/package/jose.md) ^6.1.3
- [debug](https://npm.io/package/debug.md) ^4.3.4
- [limiter](https://npm.io/package/limiter.md) ^1.1.5
- [lru-cache](https://npm.io/package/lru-cache.md) ^11.0.0
- [lru-memoizer](https://npm.io/package/lru-memoizer.md) ^3.0.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^9.0.4

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 4.1.0 (latest) — 2026-06-19
- 1.12.5 — 2026-04-30
- 1.12.4 — 2026-04-17
- 4.0.1 — 2026-03-02
- 4.0.0 — 2026-02-27
- 3.2.2 — 2026-01-23
- 3.2.1 — 2026-01-16
- 3.2.0 — 2025-03-18
- 3.1.0 — 2023-10-05
- 3.0.1 — 2023-01-12
- 3.0.0 — 2022-11-01
- 2.1.5 — 2022-10-10
- 2.1.4 — 2022-06-07
- 2.1.3 — 2022-05-20
- 2.1.2 — 2022-05-12
- … 32 more at https://npm.io/package/jwks-rsa/versions

## README

![A library to retrieve signing keys from a JWKS (JSON Web Key Set) endpoint.](https://cdn.auth0.com/website/sdks/banner/node-jwks-rsa-banner.png)

![Release](https://img.shields.io/npm/v/jwks-rsa)
[![Codecov](https://img.shields.io/codecov/c/github/auth0/node-jwks-rsa)](https://codecov.io/gh/auth0/node-jwks-rsa)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/node-jwks-rsa)
![Downloads](https://img.shields.io/npm/dw/jwks-rsa)
[![License](https://img.shields.io/:license-mit-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
![CircleCI](https://img.shields.io/circleci/build/github/auth0/node-jwks-rsa)

📚 [Documentation](#documentation) - 🚀 [Getting Started](#getting-started) - 💬 [Feedback](#feedback)

## Documentation

- [Examples](https://github.com/auth0/node-jwks-rsa/blob/master/EXAMPLES.md) - documentation of the options and code samples for common scenarios.
- [Docs Site](https://auth0.com/docs) - explore our Docs site and learn more about Auth0.

## Getting Started

### Installation

Using [npm](https://npmjs.org) in your project directory run the following command:

````bash
npm install --save jwks-rsa
````

Supports all currently registered JWK types and JWS Algorithms, see [panva/jose#262](https://github.com/panva/jose/issues/262) for more information.

### Configure the client

Provide a JWKS endpoint which exposes your signing keys.

````js
const jwksClient = require('jwks-rsa');

const client = jwksClient({
  jwksUri: 'https://sandrino.auth0.com/.well-known/jwks.json',
  requestHeaders: {}, // Optional
  timeout: 30000 // Defaults to 30s
});
````

### Retrieve a key

Then use `getSigningKey` to retrieve a signing key that matches a specific `kid`.

````js
const kid = 'RkI5MjI5OUY5ODc1N0Q4QzM0OUYzNkVGMTJDOUEzQkFCOTU3NjE2Rg';
const key = await client.getSigningKey(kid);
const signingKey = key.getPublicKey();
````

## Feedback

### Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

### Raise an issue

To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/node-jwks-rsa/issues).

### Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.

## What is Auth0?

<p align="center">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_dark_mode.png" width="150">
    <source media="(prefers-color-scheme: light)" srcset="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
    <img alt="Auth0 Logo" src="https://cdn.auth0.com/website/sdks/logos/auth0_light_mode.png" width="150">
  </picture>
</p>
<p align="center">
  Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a>
</p>
<p align="center">
  This project is licensed under the MIT license. See the <a href="https://github.com/auth0/node-jwks-rsa/blob/master/LICENSE"> LICENSE</a> file for more info.
</p>

---
_Source: https://npm.io/package/jwks-rsa · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
