@clerk/backend
3.29.0 · 14 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed
3.31.4 is the newest release of 3.x.
In short
1 fixed
Release note
Patch Changes
Scope the JWKS cache per Clerk instance. The cache was keyed on the JWT
kidalone and shared across the whole process, so an application verifying tokens for more than one Clerk instance (for example the Dynamic Keys / multi-tenant pattern) could resolve a signing key that was fetched for a different instance. Keys are now cached separately per secret key and API URL, so a token can only be verified against the instance whose credentials fetched its signing key.Networkless verification with
jwtKeyhad the same flaw: the JWK derived from the PEM was cached bykidalone, so a process verifying tokens with differentjwtKeyvalues could resolve a key derived from another instance's PEM. The JWK is now always derived from thejwtKeythat was passed in.The
jwk-kid-mismatcherror message no longer lists the key IDs currently held in the cache.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.