Packages

@clerk/shared

4.45.1 · 14 Nov 2026MIT11.8M / weekRepositorynpmAtom feed

Your version

3.28.0

15 Oct 2025Where it was published

3.48.1 is the newest release of 3.x.

In short

1 new1 fixed1 internal

Security

2 advisories affect 3.28.0; 3.47.5 fixes them

Release note

Minor Changes

  • Internal refactor of error handling to improve type safety and error classification.

    • Introduce new ClerkError base class for all Clerk errors

    • Rename internal error files: apiResponseError.ts → clerkApiResponseError.ts, runtimeError.ts → clerkRuntimeError.ts

    • Add ClerkAPIError class for individual API errors with improved type safety

    • Add type guard utilities (isClerkError, isClerkRuntimeError, isClerkApiResponseError) for better error handling

    • Deprecate clerkRuntimeError property in favor of clerkError for consistency

    • Add support for error codes, long messages, and documentation URLs

Patch Changes

  • Fixed JWT public key caching in verifyToken() to support multi-instance scenarios. Public keys are now correctly cached per kid from the token header instead of using a single shared cache key.

    What was broken:

    When verifying JWT tokens with the jwtKey option (PEM public key), all keys were cached under the same cache key. This caused verification failures in multi-instance scenarios.

    What's fixed:

    JWT public keys are now cached using the kid value from each token's header.

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.