Free tool · Next.js 16 · Auth.js v5

Paste middleware.ts.
Get proxy.ts.

Next.js 16 renamed middleware to proxy. Paste your file and get the converted proxy.ts, a diff, and a plain explanation of each change, including the Auth.js v5 export.

middleware-to-proxy — runs in your browser, nothing is sent or stored

try:

next: skip the next one

Skip the migration. The VibeBoot SaaS Starter ships with this already handled: it's on Next.js 16.4.3 with src/proxy.ts, plus auth, Stripe and a database, and AGENTS.md and .cursor/rules for your agent. $49, one-time.

14-day money-back guarantee · lifetime updates

  • 4 examples
  • nothing leaves your browser
  • checked

01What changed in Next.js 16

middleware.ts is now proxy.ts.

In Next.js 16.0.0 the middleware file convention was deprecated and renamed to proxy. Here's what the converter changes, based on the official docs:

  • →File name: middleware.ts becomes proxy.ts, in the same place (project root or src/).
  • →Export: export function middleware becomes export function proxy. A default export still works. With Auth.js v5: export { auth as proxy }.
  • →Runtime: proxy runs on Node.js by default, and setting runtime in a proxy file throws, so that line is removed.
  • →Types: NextMiddleware and MiddlewareConfig are deprecated aliases of NextProxy and ProxyConfig in 16.4.3.
  • →Unchanged: config.matcher, NextResponse, cookies, headers, rewrites and redirects.

Prefer the official codemod for a whole repo: npx @next/codemod@canary middleware-to-proxy .. It renames the file and the function. This page does the same rename for one file you paste, and points out lines worth checking. For the full Auth.js walkthrough, read Auth.js v5 on Next.js 16, step by step.

02Skip the setup

A Next.js 16 SaaS starter that's already on proxy.ts.

Skip the migration. The VibeBoot SaaS Starter ships with this already handled: it's on Next.js 16.4.3 with src/proxy.ts, plus auth, Stripe and a database, and AGENTS.md and .cursor/rules for your agent. $49, one-time.

14-day money-back guarantee · lifetime updates

See everything that's inside →
  • src/proxy.ts · no middleware.ts; exports proxy with a narrow matcher
  • auth() where the data is · dashboard, checkout and portal routes check the session themselves
  • Auth.js v5 · one src/auth.ts: trustHost, Prisma adapter, database sessions
  • Agent rules · AGENTS.md, CLAUDE.md and .cursor/rules

FAQ

Is middleware.ts still supported in Next.js 16?

The Next.js docs mark the middleware file convention as deprecated and renamed to proxy as of v16.0.0. Rename it now so you're not depending on a deprecated convention.

Does Auth.js v5 work with proxy.ts?

Yes. The Auth.js docs show export { auth as proxy } from "@/auth" for Next.js 16, or wrapping your own logic with export const proxy = auth((req) => { ... }).

Can I keep the Edge runtime?

No. Per the Next.js docs, proxy defaults to the Node.js runtime and the runtime config option isn't available in proxy files. Setting it throws an error.

Is proxy enough to protect my app?

No. The Next.js and Auth.js docs both say to verify the session close to your data. Server Functions are POSTs to the page that uses them, so a matcher change can silently drop proxy coverage. Call auth() in every protected page, route handler and server action.

Is my code sent anywhere?

No. The conversion is plain JavaScript running in this page. Nothing you paste is sent, logged or stored.

Sources: the Next.js proxy docs (including Migration to Proxy and the version history), the Auth.js protecting resources guide and the Next.js 16.4.3 type definitions. Checked Oct 27, 2026. Spotted a mistake? Email [email protected].

$ fixed it? get the next one first

New fixes for what AI agents break, by email.

When we add a fix or a Cursor rule for a new Next.js, Auth.js, Prisma or Stripe break, it goes out in the VibeBoot newsletter. Free, occasional, unsubscribe in one click.

Subscribe free

> More free tools

All tools →