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.
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.tsbecomesproxy.ts, in the same place (project root orsrc/). - →Export:
export function middlewarebecomesexport 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
runtimein a proxy file throws, so that line is removed. - →Types:
NextMiddlewareandMiddlewareConfigare deprecated aliases ofNextProxyandProxyConfigin 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.
> More free tools
All tools →- VibeBoot DoctorNewPaste any error or your package.json: diagnosis, fix and the rule that prevents it.
- AGENTS.md checkerNewCheck AGENTS.md for the Next.js 16 managed block, commands and guardrails.
- Access control checkerPaste a route or server action, see what anyone can call.
- Prisma error fixerP2002, P1001, P2021, did not initialize yet: cause and fix.
- Next.js error fixerServer Component, Suspense and hydration errors: cause and fix.
- Env leak checkerPaste your .env, see which secrets would ship to the browser.
- Stripe webhook fixerPaste a Stripe webhook error, get the cause and the fix.
- Auth.js error fixerMissingSecret, UntrustedHost, redirect_uri: cause and fix.
- AGENTS.md generatorA ready AGENTS.md and CLAUDE.md for your Next.js stack.
- Cursor Rules PackFree downloadScoped .mdc rules for Next.js, Stripe webhooks, access control and more.
- Cursor rules generatorBuild one project.mdc rule for your exact stack.
- AI chatbot cost calculatorCost per message, Pro margin and a safe free-tier cap.