# Middleware now supports Node.js

By Steven Van · 2025-02-26

Experimental Node.js runtime support for middleware arrives in Next.js 15.2 canary, still deployed globally, behind a config flag.

Node.js is now a supported runtime for middleware, so [Vercel](<https://creatorstoolbox.com/tools/vercel>) projects can use the full Node.js API set for things like authentication and personalization. Middleware is still deployed globally on Vercel, whichever runtime it uses.

The [first release](<https://vercel.com/changelog/middleware-now-supports-node-js>) is in Next.js 15.2 and is experimental. It needs the Next.js canary channel, so projects must upgrade to next@canary.

- In next.config.ts, set experimental.nodeMiddleware to true.

- In middleware.ts, export a config object with runtime: "nodejs".

![Vercel](<https://www.google.com/s2/favicons?domain=vercel.com&sz=128>)

Vercel

The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.

[View Vercel →](<https://creatorstoolbox.com/tools/vercel>)

[Original source](<https://vercel.com/changelog/middleware-now-supports-node-js>)

[Read Middleware now supports Node.js on Creators Toolbox](<https://creatorstoolbox.com/blog/vercel-middleware-now-supports-node-js>)

---
Canonical source: https://creatorstoolbox.com/blog/vercel-middleware-now-supports-node-js
