@clerk/express
2.1.90 · 14 Nov 2026MIT591.3k / weekRepositoryHomepagenpmAtom feed
2.1.97 is the newest release of 2.x.
In short
1 deprecated2 internal
- Deprecated
Deprecated
requireAuth()middleware. It will be removed in the next major version.
Security
1 advisory affects 2.1.0; 2.1.6 fixes them
- HighClerk has an authorization bypass when combining organization, billing, or reverification checksGHSA-w24r-5266-9c3c · 30 Apr 2026Fixed in 2.1.6
Release note
Minor Changes
- Deprecated
Deprecated
requireAuth()middleware. It will be removed in the next major version.The
requireAuth()middleware redirects unauthenticated requests to a sign-in page, which is often unexpected for API routes where a 401 response is more appropriate. UseclerkMiddleware()withgetAuth()instead for explicit control over authentication behavior.Before (deprecated):
import { requireAuth } from '@clerk/express'; app.get('/api/protected', requireAuth(), (req, res) => { // handle authenticated request });After (recommended):
import { clerkMiddleware, getAuth } from '@clerk/express'; app.use(clerkMiddleware()); app.get('/api/protected', (req, res) => { const { userId } = getAuth(req); if (!userId) { return res.status(401).json({ error: 'Unauthorized' }); } // handle authenticated request });
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.