---
title: "jsonwebtoken 9.0.0 Breaking Changes on npm | Since.dev"
description: "What each jsonwebtoken release removed, renamed or changed: 17 breaking changes in 1 version on npm, each with its source."
canonical_url: https://since.dev/packages/npm/jsonwebtoken
last_updated: 2026-12-04
---

# jsonwebtoken breaking changes

jsonwebtoken 9.0.0 (December 21, 2022) is its newest release with breaking changes, 17 of them. The first: Drops support for Node.js versions 11 and below in jsonwebtoken 9.0.0. Every breaking API change we have recorded in jsonwebtoken on npm: 17 breaking changes in 1 version. Below, its one version with breaking changes, newest first, removals and renames first, each with its source.

Updated December 4, 2026

Latest version `9.0.3`, released December 4, 2025. [Source repository](https://github.com/auth0/node-jsonwebtoken)

Packages on npm run on Node.js. [Node.js end of life dates](https://since.dev/calendar/nodejs.md).

## jsonwebtoken 9.0.0 breaking changes

jsonwebtoken 9.0.0, released December 21, 2022: 17 breaking changes.

- **Removed**  

Code running on Node.js 11 or older will no longer work with this release. Upgrade to Node.js 12 or later. [github.com](https://github.com/auth0/node-jsonwebtoken/blob/v9.0.0/CHANGELOG.md)
- **Behavior changed**  

secretOrPublicKey and secretOrPrivateKey must be valid key material compatible with Node's createSecretKey, createPrivateKey or createPublicKey. [github.com](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v8-to-v9)
- **Behavior changed**  

sign and verify now fail when an asymmetric key is passed with HS algorithms. Use a secret key for HMAC tokens. [github.com](https://github.com/auth0/node-jsonwebtoken/wiki/Migration-Notes:-v8-to-v9)
- **Behavior changed**  

Keys whose type does not fit the algorithm now cause sign and verify to fail. Set allowInvalidAsymmetricKeyTypes to keep the old behaviour. [github.com](https://github.com/auth0/node-jsonwebtoken/blob/v9.0.0/CHANGELOG.md)
- **Behavior changed** `sign`  

Signing with RSA keys under 2048 bits now fails. Set the allowInsecureKeySizes option to true to keep the old behaviour. [github.com](https://github.com/auth0/node-jsonwebtoken/blob/v9.0.0/CHANGELOG.md)
- **Behavior changed** `verify`  

To accept unsigned tokens you must now explicitly pass 'none' in options.algorithms. [github.com](https://github.com/auth0/node-jsonwebtoken/blob/v9.0.0/CHANGELOG.md)
- **Signature changed** `Algorithm`  

Was type Algorithm = "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512" | "none"; now type Algorithm = | "HS256" | "HS384" | "HS512" | "RS256" | "RS384" | "RS512" | "ES256"... [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `Secret`  

Was type Secret = | string | Buffer | {key: string | Buffer; passphrase: string}; now type Secret = | string | Buffer | KeyObject | {key: string | Buffer; passphrase: string}. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `sign`  

Was function sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, callback: SignCallback): void function sign(payload: string | Buffer | object, secretOrPrivateKey: Secret, options: SignOptions, callback: SignCallback): void... [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `SignCallback`  

Was type SignCallback = (error: Error | null, encoded: string | undefined) => void; now type SignCallback = (error: Error | null, encoded?: string | undefined) => void. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `SigningKeyCallback`  

Was type SigningKeyCallback = (error: Error | null, signingKey?: Secret) => void; now type SigningKeyCallback = (error: Error | null, signingKey?: Secret | PublicKey) => void. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `SignOptions.expiresIn`  

Was expiresIn?: string | number | undefined; now expiresIn?: StringValue | number. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `SignOptions.notBefore`  

Was notBefore?: string | number | undefined; now notBefore?: StringValue | number | undefined. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `verify`  

Was function verify(token: string, secretOrPublicKey: Secret | GetPublicKeyOrSecret, callback?: VerifyCallback\<JwtPayload | string>): void function verify(token: string, secretOrPublicKey: Secret | GetPublicKeyOrSecret, options... [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `VerifyCallback`  

Was type VerifyCallback\<T = Jwt | JwtPayload | string> = (error: VerifyErrors | null, decoded: T | undefined) => void; now type VerifyCallback\<T = Jwt | JwtPayload | string> = (error: VerifyErrors | null, decoded?: T | undefined) => void. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `VerifyOptions.audience`  

Was audience?: string | RegExp | Array\<string | RegExp> | undefined; now audience?: string | RegExp | \[string | RegExp, ...(string | RegExp)\[\]\] | undefined. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)
- **Signature changed** `VerifyOptions.issuer`  

Was issuer?: string | string\[\] | undefined; now issuer?: string | \[string, ...(string\[\])\] | undefined. [npmjs.com](https://www.npmjs.com/package/jsonwebtoken/v/9.0.0)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#api) reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

## Put your code on continuous maintenance.

Scan a public repository now, or give your agent one line.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
