Packages

@clerk/express

2.1.90 · 14 Nov 2026MIT604.4k / weekRepositoryHomepagenpmAtom feed

Your version

1.7.0

13 Jun 2025Where it was published

1.7.85 is the newest release of 1.x.

In short

1 new3 internal

Security

2 advisories affect 1.7.0; 1.7.79 fixes them

Release note

Minor Changes

  • Introduces machine authentication, supporting four token types: api_key, oauth_token, machine_token, and session_token. For backwards compatibility, session_token remains the default when no token type is specified. This enables machine-to-machine authentication and use cases such as API keys and OAuth integrations. Existing applications continue to work without modification.

    You can specify which token types are allowed by using the acceptsToken option in the getAuth() function. This option can be set to a specific type, an array of types, or 'any' to accept all supported tokens.

    Example usage:

    import express from 'express';
    import { getAuth } from '@clerk/express';
    
    const app = express();
    
    app.get('/path', (req, res) => {
      const authObject = getAuth(req, { acceptsToken: 'any' });
    
      if (authObject.tokenType === 'session_token') {
        console.log('this is session token from a user');
      } else {
        console.log('this is some other type of machine token');
        console.log('more specifically, a ' + authObject.tokenType);
      }
    });

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.