Packages

@clerk/backend

3.29.0 · 14 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed

Your version

2.1.0

13 Jun 2025Where it was published

2.33.9 is the newest release of 2.x.

In short

3 new4 fixed2 internal

Security

2 advisories affect 2.1.0; 2.33.3 fixes them

Release note

Minor Changes

  • Improve subject property handling for machine auth objects.

    Usage:

    import { createClerkClient } from '@clerk/backend';
    
    const clerkClient = createClerkClient({
      secretKey: process.env.CLERK_SECRET_KEY,
      publishableKey: process.env.CLERK_PUBLISHABLE_KEY,
    });
    
    const requestState = await clerkClient.authenticateRequest(request, {
      acceptsToken: 'any',
    });
    
    const authObject = requestState.toAuth();
    
    switch (authObject.tokenType) {
      case 'api_key':
        // authObject.userId
        // authObject.orgId
        break;
      case 'machine_token':
        // authObject.machineId
        break;
      case 'oauth_token':
        // authObject.userId
        // authObject.clientId
        break;
    }
  • Respect acceptsToken when returning unauthenticated session or machine object.

Patch Changes

  • Re-organize internal types for the recently added "machine authentication" feature.

  • Fix calculation of handshake URL when proxy URL is set on the ClerkProvider

  • Add JSdoc comments for user methods.

  • Updating type of Verification.status

  • Resolve machine token property mixing in discriminated unions

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.