Express SDK

Category
SDK
Published

Add authentication and authorization to your Express application in minutes with the new Clerk SDK

We're excited to announce the release of @clerk/express, our latest SDK designed specifically for Express applications.

The SDK comes fully equipped with server utilities and low level utilities for any of your custom flows.

Here's an example on how simple it is to protect a route with our Express SDK:

import express from 'express'
import { requireAuth } from '@clerk/express'

const app = express()

// if the user is not signed in, they will be redirected to /sign-in automatically
app.get('/protected', requireAuth({ signInUrl: '/sign-in' }), (req, res) => {
  return res.json({ userId: req.auth.userId })
})

Deprecating @clerk/clerk-sdk-node

With this release, we are initiating the process to deprecate @clerk/clerk-sdk-node.

During this transition period, we intend to:

  • Continue to provide critical patches and bug fixes for @clerk/clerk-sdk-node
  • Pause adding new features to @clerk/clerk-sdk-node
  • Focus our development efforts on @clerk/express

The transition to end @clerk/clerk-sdk-node support ends on January 8, 2025. To ensure a smooth transition, we've prepared a comprehensive Migration Guide with step-by-step instructions.

Upgrade today and experience enhanced authentication and user management in your Express projects with Clerk!