[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-vercel-routing-middleware":3,"mdc--10kzm3-key":34,"related-repo-vercel-routing-middleware":3512,"related-org-vercel-routing-middleware":3624},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":23,"repoUrl":24,"updatedAt":25,"license":26,"forks":27,"topics":28,"repo":29,"sourceUrl":32,"mdContent":33},"routing-middleware","implement Vercel routing middleware","Vercel Routing Middleware guidance — request interception before cache, rewrites, redirects, personalization. Works with any framework. Supports Edge, Node.js, and Bun runtimes. Use when intercepting requests at the platform level.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"vercel","Vercel","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fvercel.png",[12,16,19,20],{"name":13,"slug":14,"type":15},"Security","security","tag",{"name":17,"slug":18,"type":15},"Performance","performance",{"name":9,"slug":8,"type":15},{"name":21,"slug":22,"type":15},"Backend","backend",226,"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fvercel-plugin","2026-04-06T18:56:23.314526",null,36,[],{"repoUrl":24,"stars":23,"forks":27,"topics":30,"description":31},[],"Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.","https:\u002F\u002Fgithub.com\u002Fvercel\u002Fvercel-plugin\u002Ftree\u002FHEAD\u002Fskills\u002Frouting-middleware","---\nname: routing-middleware\ndescription: Vercel Routing Middleware guidance — request interception before cache, rewrites, redirects, personalization. Works with any framework. Supports Edge, Node.js, and Bun runtimes. Use when intercepting requests at the platform level.\nmetadata:\n  priority: 6\n  docs:\n    - \"https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frouting\u002Fmiddleware\"\n    - \"https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\"\n  sitemap: \"https:\u002F\u002Fnextjs.org\u002Fsitemap.xml\"\n  pathPatterns: \n    - 'middleware.ts'\n    - 'middleware.js'\n    - 'middleware.mts'\n    - 'middleware.mjs'\n    - 'proxy.ts'\n    - 'proxy.js'\n    - 'proxy.mts'\n    - 'proxy.mjs'\n    - 'src\u002Fmiddleware.ts'\n    - 'src\u002Fmiddleware.js'\n    - 'src\u002Fmiddleware.mts'\n    - 'src\u002Fmiddleware.mjs'\n    - 'src\u002Fproxy.ts'\n    - 'src\u002Fproxy.js'\n    - 'src\u002Fproxy.mts'\n    - 'src\u002Fproxy.mjs'\n    - 'vercel.json'\n    - 'apps\u002F*\u002Fvercel.json'\n    - 'vercel.ts'\n    - 'vercel.mts'\n  bashPatterns:\n    - '\\bnpx\\s+@vercel\u002Fconfig\\b'\nvalidate:\n  -\n    pattern: 'NextResponse.*from\\s+[''\"]next\u002Fserver[''\"]|from\\s+[''\"]next\u002Fserver[''\"].*NextResponse'\n    message: 'Next.js middleware.ts is renamed to proxy.ts in Next.js 16 — rename the file and use the Node.js runtime. Run Skill(nextjs) for proxy.ts migration guidance.'\n    severity: recommended\n    upgradeToSkill: nextjs\n    upgradeWhy: 'Guides migration from middleware.ts to proxy.ts with correct file placement, Node.js runtime, and Next.js 16 patterns.'\n    skipIfFileContains: 'proxy\\.ts|runtime.*nodejs'\nretrieval:\n  aliases:\n    - request interceptor\n    - middleware\n    - rewrite rules\n    - redirect rules\n  intents:\n    - intercept requests\n    - add middleware\n    - configure rewrites\n    - set up redirects\n  entities:\n    - middleware\n    - rewrite\n    - redirect\n    - personalization\n    - Edge\nchainTo:\n  -\n    pattern: 'from\\s+[''\"\"]next-auth[''\"\"]'\n    targetSkill: auth\n    message: 'Auth logic in middleware — loading Auth guidance for Clerk\u002FAuth0 integration patterns.'\n  -\n    pattern: 'NextResponse.*from\\s+[''\"]next\u002Fserver[''\"]|from\\s+[''\"]next\u002Fserver[''\"].*NextResponse'\n    targetSkill: nextjs\n    message: 'middleware.ts with next\u002Fserver imports detected — loading Next.js guidance for proxy.ts migration (Next.js 16 renames middleware.ts to proxy.ts with Node.js runtime).'\n    skipIfFileContains: 'proxy\\.ts|runtime.*nodejs'\n  -\n    pattern: 'from\\s+[''\"\"](jsonwebtoken)[''\"\"]|jwt\\.(verify|decode)\\('\n    targetSkill: auth\n    message: 'Manual JWT verification in middleware — loading Auth guidance for managed auth middleware patterns (Clerk, Descope).'\n    skipIfFileContains: 'clerkMiddleware|@clerk\u002F|@auth0\u002F'\n\n---\n\n# Vercel Routing Middleware\n\nYou are an expert in Vercel Routing Middleware — the platform-level request interception layer.\n\n## What It Is\n\nRouting Middleware runs **before the cache** on every request matching its config. It is a **Vercel platform** feature (not framework-specific) that works with Next.js, SvelteKit, Astro, Nuxt, or any deployed framework. Built on Fluid Compute.\n\n- **File**: `middleware.ts` or `middleware.js` at the project root\n- **Default export required** (function name can be anything)\n- **Runtimes**: Edge (default), Node.js (`runtime: 'nodejs'`), Bun (Node.js + `bunVersion` in vercel.json)\n\n## CRITICAL: Middleware Disambiguation\n\nThere are THREE \"middleware\" concepts in the Vercel ecosystem:\n\n| Concept | File | Runtime | Scope | When to Use |\n|---------|------|---------|-------|-------------|\n| **Vercel Routing Middleware** | `middleware.ts` (root) | Edge\u002FNode\u002FBun | Any framework, platform-level | Request interception before cache: rewrites, redirects, geo, A\u002FB |\n| **Next.js 16 Proxy** | `proxy.ts` (root, or `src\u002Fproxy.ts` if using `--src-dir`) | Node.js only | Next.js 16+ only | Network-boundary proxy needing full Node APIs. NOT for auth. |\n| **Edge Functions** | Any function file | V8 isolates | General-purpose | Standalone edge compute endpoints, not an interception layer |\n\n**Why the rename in Next.js 16**: `middleware.ts` → `proxy.ts` clarifies it sits at the network boundary (not general-purpose middleware). Partly motivated by CVE-2025-29927 (middleware auth bypass via `x-middleware-subrequest` header). The exported function must also be renamed from `middleware` to `proxy`. Migration codemod: `npx @next\u002Fcodemod@latest middleware-to-proxy`\n\n**Deprecation**: Next.js 16 still accepts `middleware.ts` but treats it as deprecated and logs a warning. It will be removed in a future version.\n\n## Bun Runtime\n\nTo run Routing Middleware (and all Vercel Functions) on Bun, add `bunVersion` to `vercel.json`:\n\n```json\n{\n  \"bunVersion\": \"1.x\"\n}\n```\n\nSet the middleware runtime to `nodejs` — Bun replaces the Node.js runtime transparently:\n\n```ts\nexport const config = {\n  runtime: 'nodejs', \u002F\u002F Bun swaps in when bunVersion is set\n};\n```\n\nBun reduces average latency by ~28% in CPU-bound workloads. Currently in Public Beta — supports Next.js, Express, Hono, and Nitro.\n\n## Basic Example\n\n```ts\n\u002F\u002F middleware.ts (project root)\nimport { geolocation, rewrite } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request) {\n  const { country } = geolocation(request);\n  const url = new URL(request.url);\n  url.pathname = country === 'US' ? '\u002Fus' + url.pathname : '\u002Fintl' + url.pathname;\n  return rewrite(url);\n}\n\nexport const config = {\n  runtime: 'edge', \u002F\u002F 'edge' (default) | 'nodejs'\n};\n```\n\n## Helper Methods (`@vercel\u002Ffunctions`)\n\nFor non-Next.js frameworks, import from `@vercel\u002Ffunctions`:\n\n| Helper | Purpose |\n|--------|---------|\n| `next()` | Continue middleware chain (optionally modify headers) |\n| `rewrite(url)` | Transparently serve content from a different URL |\n| `geolocation(request)` | Get `city`, `country`, `latitude`, `longitude`, `region` |\n| `ipAddress(request)` | Get client IP address |\n| `waitUntil(promise)` | Keep function running after response is sent |\n\nFor Next.js, equivalent helpers are on `NextResponse` (`next()`, `rewrite()`, `redirect()`) and `NextRequest` (`request.geo`, `request.ip`).\n\n## Matcher Configuration\n\nMiddleware runs on **every route** by default. Use `config.matcher` to scope it:\n\n```ts\n\u002F\u002F Single path\nexport const config = { matcher: '\u002Fdashboard\u002F:path*' };\n\n\u002F\u002F Multiple paths\nexport const config = { matcher: ['\u002Fdashboard\u002F:path*', '\u002Fapi\u002F:path*'] };\n\n\u002F\u002F Regex: exclude static files\nexport const config = {\n  matcher: ['\u002F((?!_next\u002Fstatic|favicon.ico).*)'],\n};\n```\n\n**Tip**: Using `matcher` is preferred — unmatched paths skip middleware invocation entirely (saves compute).\n\n## Common Patterns\n\n### IP-Based Header Injection\n\n```ts\nimport { ipAddress, next } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request) {\n  return next({ headers: { 'x-real-ip': ipAddress(request) || 'unknown' } });\n}\n```\n\n### A\u002FB Testing via Edge Config\n\n```ts\nimport { get } from '@vercel\u002Fedge-config';\nimport { rewrite } from '@vercel\u002Ffunctions';\n\nexport default async function middleware(request: Request) {\n  const variant = await get('experiment-homepage'); \u002F\u002F \u003C1ms read\n  const url = new URL(request.url);\n  url.pathname = variant === 'B' ? '\u002Fhome-b' : '\u002Fhome-a';\n  return rewrite(url);\n}\n```\n\n### Background Processing\n\n```ts\nimport type { RequestContext } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request, context: RequestContext) {\n  context.waitUntil(\n    fetch('https:\u002F\u002Fanalytics.example.com\u002Flog', { method: 'POST', body: request.url })\n  );\n  return new Response('OK');\n}\n```\n\n## Request Limits\n\n| Limit | Value |\n|-------|-------|\n| Max URL length | 14 KB |\n| Max request body | 4 MB |\n| Max request headers | 64 headers \u002F 16 KB total |\n\n## Three CDN Routing Mechanisms\n\nVercel's CDN supports three routing mechanisms, evaluated in this order:\n\n| Order | Mechanism | Scope | Deploy Required | How to Configure |\n|-------|-----------|-------|-----------------|------------------|\n| 1 | **Bulk Redirects** | Up to 1M static path→path redirects | No (runtime via Dashboard\u002FAPI\u002FCLI) | Dashboard, CSV upload, REST API |\n| 2 | **Project-Level Routes** | Headers, rewrites, redirects | No (instant publish) | Dashboard, API, CLI, Vercel SDK |\n| 3 | **Deployment Config Routes** | Full routing rules | Yes (deploy) | `vercel.json`, `vercel.ts`, `next.config.ts` |\n\n**Project-level routes** (added March 2026) let you update routing rules — response headers, rewrites to external APIs — without triggering a new deployment. They run after bulk redirects and before deployment config routes. Available on all plans.\n\n### Project-Level Routes — Configuration Methods\n\nProject-level routes take effect instantly (no deploy required). Four ways to manage them:\n\n| Method | How |\n|--------|-----|\n| **Dashboard** | Project → CDN → Routing tab. Live map of global traffic, cache management, and route editor in one view. |\n| **REST API** | `GET\u002FPOST\u002FPATCH\u002FDELETE \u002Fv1\u002Fprojects\u002F{projectId}\u002Froutes` — 8 dedicated endpoints for CRUD on project routes. |\n| **Vercel CLI** | Managed via `vercel.ts` \u002F `@vercel\u002Fconfig` commands (`compile`, `validate`, `generate`). |\n| **Vercel SDK** | `@vercel\u002Fconfig` helpers: `routes.redirect()`, `routes.rewrite()`, `routes.header()`, plus `has`\u002F`missing` conditions and transforms. |\n\nUse project-level routes for operational changes (CORS headers, API proxy rewrites, A\u002FB redirects) that shouldn't require a full redeploy.\n\n## Programmatic Configuration with `vercel.ts`\n\nInstead of static `vercel.json`, you can use `vercel.ts` (or `.js`, `.mjs`, `.cjs`, `.mts`) with the `@vercel\u002Fconfig` package for type-safe, dynamic routing configuration:\n\n```ts\n\u002F\u002F vercel.ts\nimport { defineConfig } from '@vercel\u002Fconfig';\n\nexport default defineConfig({\n  rewrites: [\n    { source: '\u002Fapi\u002F:path*', destination: 'https:\u002F\u002Fbackend.example.com\u002F:path*' },\n  ],\n  headers: [\n    { source: '\u002F(.*)', headers: [{ key: 'X-Frame-Options', value: 'DENY' }] },\n  ],\n});\n```\n\nCLI commands:\n- `npx @vercel\u002Fconfig compile` — compile to JSON (stdout)\n- `npx @vercel\u002Fconfig validate` — validate and show summary\n- `npx @vercel\u002Fconfig generate` — generate `vercel.json` locally for development\n\n**Constraint**: Only one config file per project — `vercel.json` or `vercel.ts`, not both.\n\n## When to Use\n\n- Geo-personalization of static pages (runs before cache)\n- A\u002FB testing rewrites with Edge Config\n- Custom redirects based on request properties\n- Header injection (CSP, CORS, custom headers)\n- Lightweight auth checks (defense-in-depth only — not sole auth layer)\n- Project-level routes for headers\u002Frewrites without redeploying\n\n## When NOT to Use\n\n- Need full Node.js APIs in Next.js → use `proxy.ts`\n- General compute at the edge → use Edge Functions\n- Heavy business logic or database queries → use server-side framework features\n- Auth as sole protection → use Layouts, Server Components, or Route Handlers\n- Thousands of static redirects → use Bulk Redirects (up to 1M per project)\n\n## References\n\n- 📖 docs: https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\n- 📖 API reference: https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\u002Fapi\n- 📖 getting started: https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\u002Fgetting-started\n",{"data":35,"body":100},{"name":4,"description":6,"metadata":36,"validate":65,"retrieval":73,"chainTo":89},{"priority":37,"docs":38,"sitemap":41,"pathPatterns":42,"bashPatterns":63},6,[39,40],"https:\u002F\u002Fnextjs.org\u002Fdocs\u002Fapp\u002Fbuilding-your-application\u002Frouting\u002Fmiddleware","https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware","https:\u002F\u002Fnextjs.org\u002Fsitemap.xml",[43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62],"middleware.ts","middleware.js","middleware.mts","middleware.mjs","proxy.ts","proxy.js","proxy.mts","proxy.mjs","src\u002Fmiddleware.ts","src\u002Fmiddleware.js","src\u002Fmiddleware.mts","src\u002Fmiddleware.mjs","src\u002Fproxy.ts","src\u002Fproxy.js","src\u002Fproxy.mts","src\u002Fproxy.mjs","vercel.json","apps\u002F*\u002Fvercel.json","vercel.ts","vercel.mts",[64],"\\bnpx\\s+@vercel\u002Fconfig\\b",[66],{"pattern":67,"message":68,"severity":69,"upgradeToSkill":70,"upgradeWhy":71,"skipIfFileContains":72},"NextResponse.*from\\s+['\"]next\u002Fserver['\"]|from\\s+['\"]next\u002Fserver['\"].*NextResponse","Next.js middleware.ts is renamed to proxy.ts in Next.js 16 — rename the file and use the Node.js runtime. Run Skill(nextjs) for proxy.ts migration guidance.","recommended","nextjs","Guides migration from middleware.ts to proxy.ts with correct file placement, Node.js runtime, and Next.js 16 patterns.","proxy\\.ts|runtime.*nodejs",{"aliases":74,"intents":79,"entities":84},[75,76,77,78],"request interceptor","middleware","rewrite rules","redirect rules",[80,81,82,83],"intercept requests","add middleware","configure rewrites","set up redirects",[76,85,86,87,88],"rewrite","redirect","personalization","Edge",[90,94,96],{"pattern":91,"targetSkill":92,"message":93},"from\\s+['\"\"]next-auth['\"\"]","auth","Auth logic in middleware — loading Auth guidance for Clerk\u002FAuth0 integration patterns.",{"pattern":67,"targetSkill":70,"message":95,"skipIfFileContains":72},"middleware.ts with next\u002Fserver imports detected — loading Next.js guidance for proxy.ts migration (Next.js 16 renames middleware.ts to proxy.ts with Node.js runtime).",{"pattern":97,"targetSkill":92,"message":98,"skipIfFileContains":99},"from\\s+['\"\"](jsonwebtoken)['\"\"]|jwt\\.(verify|decode)\\(","Manual JWT verification in middleware — loading Auth guidance for managed auth middleware patterns (Clerk, Descope).","clerkMiddleware|@clerk\u002F|@auth0\u002F",{"type":101,"children":102},"root",[103,112,118,125,145,211,217,222,381,433,450,456,474,545,558,643,648,654,1113,1125,1136,1278,1334,1340,1360,1598,1616,1622,1629,1843,1849,2206,2212,2503,2509,2570,2576,2581,2726,2736,2742,2747,2918,2923,2934,2989,3315,3320,3363,3386,3391,3424,3430,3463,3469,3506],{"type":104,"tag":105,"props":106,"children":108},"element","h1",{"id":107},"vercel-routing-middleware",[109],{"type":110,"value":111},"text","Vercel Routing Middleware",{"type":104,"tag":113,"props":114,"children":115},"p",{},[116],{"type":110,"value":117},"You are an expert in Vercel Routing Middleware — the platform-level request interception layer.",{"type":104,"tag":119,"props":120,"children":122},"h2",{"id":121},"what-it-is",[123],{"type":110,"value":124},"What It Is",{"type":104,"tag":113,"props":126,"children":127},{},[128,130,136,138,143],{"type":110,"value":129},"Routing Middleware runs ",{"type":104,"tag":131,"props":132,"children":133},"strong",{},[134],{"type":110,"value":135},"before the cache",{"type":110,"value":137}," on every request matching its config. It is a ",{"type":104,"tag":131,"props":139,"children":140},{},[141],{"type":110,"value":142},"Vercel platform",{"type":110,"value":144}," feature (not framework-specific) that works with Next.js, SvelteKit, Astro, Nuxt, or any deployed framework. Built on Fluid Compute.",{"type":104,"tag":146,"props":147,"children":148},"ul",{},[149,175,185],{"type":104,"tag":150,"props":151,"children":152},"li",{},[153,158,160,166,168,173],{"type":104,"tag":131,"props":154,"children":155},{},[156],{"type":110,"value":157},"File",{"type":110,"value":159},": ",{"type":104,"tag":161,"props":162,"children":164},"code",{"className":163},[],[165],{"type":110,"value":43},{"type":110,"value":167}," or ",{"type":104,"tag":161,"props":169,"children":171},{"className":170},[],[172],{"type":110,"value":44},{"type":110,"value":174}," at the project root",{"type":104,"tag":150,"props":176,"children":177},{},[178,183],{"type":104,"tag":131,"props":179,"children":180},{},[181],{"type":110,"value":182},"Default export required",{"type":110,"value":184}," (function name can be anything)",{"type":104,"tag":150,"props":186,"children":187},{},[188,193,195,201,203,209],{"type":104,"tag":131,"props":189,"children":190},{},[191],{"type":110,"value":192},"Runtimes",{"type":110,"value":194},": Edge (default), Node.js (",{"type":104,"tag":161,"props":196,"children":198},{"className":197},[],[199],{"type":110,"value":200},"runtime: 'nodejs'",{"type":110,"value":202},"), Bun (Node.js + ",{"type":104,"tag":161,"props":204,"children":206},{"className":205},[],[207],{"type":110,"value":208},"bunVersion",{"type":110,"value":210}," in vercel.json)",{"type":104,"tag":119,"props":212,"children":214},{"id":213},"critical-middleware-disambiguation",[215],{"type":110,"value":216},"CRITICAL: Middleware Disambiguation",{"type":104,"tag":113,"props":218,"children":219},{},[220],{"type":110,"value":221},"There are THREE \"middleware\" concepts in the Vercel ecosystem:",{"type":104,"tag":223,"props":224,"children":225},"table",{},[226,259],{"type":104,"tag":227,"props":228,"children":229},"thead",{},[230],{"type":104,"tag":231,"props":232,"children":233},"tr",{},[234,240,244,249,254],{"type":104,"tag":235,"props":236,"children":237},"th",{},[238],{"type":110,"value":239},"Concept",{"type":104,"tag":235,"props":241,"children":242},{},[243],{"type":110,"value":157},{"type":104,"tag":235,"props":245,"children":246},{},[247],{"type":110,"value":248},"Runtime",{"type":104,"tag":235,"props":250,"children":251},{},[252],{"type":110,"value":253},"Scope",{"type":104,"tag":235,"props":255,"children":256},{},[257],{"type":110,"value":258},"When to Use",{"type":104,"tag":260,"props":261,"children":262},"tbody",{},[263,299,350],{"type":104,"tag":231,"props":264,"children":265},{},[266,274,284,289,294],{"type":104,"tag":267,"props":268,"children":269},"td",{},[270],{"type":104,"tag":131,"props":271,"children":272},{},[273],{"type":110,"value":111},{"type":104,"tag":267,"props":275,"children":276},{},[277,282],{"type":104,"tag":161,"props":278,"children":280},{"className":279},[],[281],{"type":110,"value":43},{"type":110,"value":283}," (root)",{"type":104,"tag":267,"props":285,"children":286},{},[287],{"type":110,"value":288},"Edge\u002FNode\u002FBun",{"type":104,"tag":267,"props":290,"children":291},{},[292],{"type":110,"value":293},"Any framework, platform-level",{"type":104,"tag":267,"props":295,"children":296},{},[297],{"type":110,"value":298},"Request interception before cache: rewrites, redirects, geo, A\u002FB",{"type":104,"tag":231,"props":300,"children":301},{},[302,310,335,340,345],{"type":104,"tag":267,"props":303,"children":304},{},[305],{"type":104,"tag":131,"props":306,"children":307},{},[308],{"type":110,"value":309},"Next.js 16 Proxy",{"type":104,"tag":267,"props":311,"children":312},{},[313,318,320,325,327,333],{"type":104,"tag":161,"props":314,"children":316},{"className":315},[],[317],{"type":110,"value":47},{"type":110,"value":319}," (root, or ",{"type":104,"tag":161,"props":321,"children":323},{"className":322},[],[324],{"type":110,"value":55},{"type":110,"value":326}," if using ",{"type":104,"tag":161,"props":328,"children":330},{"className":329},[],[331],{"type":110,"value":332},"--src-dir",{"type":110,"value":334},")",{"type":104,"tag":267,"props":336,"children":337},{},[338],{"type":110,"value":339},"Node.js only",{"type":104,"tag":267,"props":341,"children":342},{},[343],{"type":110,"value":344},"Next.js 16+ only",{"type":104,"tag":267,"props":346,"children":347},{},[348],{"type":110,"value":349},"Network-boundary proxy needing full Node APIs. NOT for auth.",{"type":104,"tag":231,"props":351,"children":352},{},[353,361,366,371,376],{"type":104,"tag":267,"props":354,"children":355},{},[356],{"type":104,"tag":131,"props":357,"children":358},{},[359],{"type":110,"value":360},"Edge Functions",{"type":104,"tag":267,"props":362,"children":363},{},[364],{"type":110,"value":365},"Any function file",{"type":104,"tag":267,"props":367,"children":368},{},[369],{"type":110,"value":370},"V8 isolates",{"type":104,"tag":267,"props":372,"children":373},{},[374],{"type":110,"value":375},"General-purpose",{"type":104,"tag":267,"props":377,"children":378},{},[379],{"type":110,"value":380},"Standalone edge compute endpoints, not an interception layer",{"type":104,"tag":113,"props":382,"children":383},{},[384,389,390,395,397,402,404,410,412,417,419,425,427],{"type":104,"tag":131,"props":385,"children":386},{},[387],{"type":110,"value":388},"Why the rename in Next.js 16",{"type":110,"value":159},{"type":104,"tag":161,"props":391,"children":393},{"className":392},[],[394],{"type":110,"value":43},{"type":110,"value":396}," → ",{"type":104,"tag":161,"props":398,"children":400},{"className":399},[],[401],{"type":110,"value":47},{"type":110,"value":403}," clarifies it sits at the network boundary (not general-purpose middleware). Partly motivated by CVE-2025-29927 (middleware auth bypass via ",{"type":104,"tag":161,"props":405,"children":407},{"className":406},[],[408],{"type":110,"value":409},"x-middleware-subrequest",{"type":110,"value":411}," header). The exported function must also be renamed from ",{"type":104,"tag":161,"props":413,"children":415},{"className":414},[],[416],{"type":110,"value":76},{"type":110,"value":418}," to ",{"type":104,"tag":161,"props":420,"children":422},{"className":421},[],[423],{"type":110,"value":424},"proxy",{"type":110,"value":426},". Migration codemod: ",{"type":104,"tag":161,"props":428,"children":430},{"className":429},[],[431],{"type":110,"value":432},"npx @next\u002Fcodemod@latest middleware-to-proxy",{"type":104,"tag":113,"props":434,"children":435},{},[436,441,443,448],{"type":104,"tag":131,"props":437,"children":438},{},[439],{"type":110,"value":440},"Deprecation",{"type":110,"value":442},": Next.js 16 still accepts ",{"type":104,"tag":161,"props":444,"children":446},{"className":445},[],[447],{"type":110,"value":43},{"type":110,"value":449}," but treats it as deprecated and logs a warning. It will be removed in a future version.",{"type":104,"tag":119,"props":451,"children":453},{"id":452},"bun-runtime",[454],{"type":110,"value":455},"Bun Runtime",{"type":104,"tag":113,"props":457,"children":458},{},[459,461,466,467,472],{"type":110,"value":460},"To run Routing Middleware (and all Vercel Functions) on Bun, add ",{"type":104,"tag":161,"props":462,"children":464},{"className":463},[],[465],{"type":110,"value":208},{"type":110,"value":418},{"type":104,"tag":161,"props":468,"children":470},{"className":469},[],[471],{"type":110,"value":59},{"type":110,"value":473},":",{"type":104,"tag":475,"props":476,"children":481},"pre",{"className":477,"code":478,"language":479,"meta":480,"style":480},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"bunVersion\": \"1.x\"\n}\n","json","",[482],{"type":104,"tag":161,"props":483,"children":484},{"__ignoreMap":480},[485,497,536],{"type":104,"tag":486,"props":487,"children":490},"span",{"class":488,"line":489},"line",1,[491],{"type":104,"tag":486,"props":492,"children":494},{"style":493},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[495],{"type":110,"value":496},"{\n",{"type":104,"tag":486,"props":498,"children":500},{"class":488,"line":499},2,[501,506,511,516,520,525,531],{"type":104,"tag":486,"props":502,"children":503},{"style":493},[504],{"type":110,"value":505},"  \"",{"type":104,"tag":486,"props":507,"children":509},{"style":508},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[510],{"type":110,"value":208},{"type":104,"tag":486,"props":512,"children":513},{"style":493},[514],{"type":110,"value":515},"\"",{"type":104,"tag":486,"props":517,"children":518},{"style":493},[519],{"type":110,"value":473},{"type":104,"tag":486,"props":521,"children":522},{"style":493},[523],{"type":110,"value":524}," \"",{"type":104,"tag":486,"props":526,"children":528},{"style":527},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[529],{"type":110,"value":530},"1.x",{"type":104,"tag":486,"props":532,"children":533},{"style":493},[534],{"type":110,"value":535},"\"\n",{"type":104,"tag":486,"props":537,"children":539},{"class":488,"line":538},3,[540],{"type":104,"tag":486,"props":541,"children":542},{"style":493},[543],{"type":110,"value":544},"}\n",{"type":104,"tag":113,"props":546,"children":547},{},[548,550,556],{"type":110,"value":549},"Set the middleware runtime to ",{"type":104,"tag":161,"props":551,"children":553},{"className":552},[],[554],{"type":110,"value":555},"nodejs",{"type":110,"value":557}," — Bun replaces the Node.js runtime transparently:",{"type":104,"tag":475,"props":559,"children":563},{"className":560,"code":561,"language":562,"meta":480,"style":480},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export const config = {\n  runtime: 'nodejs', \u002F\u002F Bun swaps in when bunVersion is set\n};\n","ts",[564],{"type":104,"tag":161,"props":565,"children":566},{"__ignoreMap":480},[567,597,635],{"type":104,"tag":486,"props":568,"children":569},{"class":488,"line":489},[570,576,581,587,592],{"type":104,"tag":486,"props":571,"children":573},{"style":572},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[574],{"type":110,"value":575},"export",{"type":104,"tag":486,"props":577,"children":578},{"style":508},[579],{"type":110,"value":580}," const",{"type":104,"tag":486,"props":582,"children":584},{"style":583},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[585],{"type":110,"value":586}," config ",{"type":104,"tag":486,"props":588,"children":589},{"style":493},[590],{"type":110,"value":591},"=",{"type":104,"tag":486,"props":593,"children":594},{"style":493},[595],{"type":110,"value":596}," {\n",{"type":104,"tag":486,"props":598,"children":599},{"class":488,"line":499},[600,606,610,615,619,624,629],{"type":104,"tag":486,"props":601,"children":603},{"style":602},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[604],{"type":110,"value":605},"  runtime",{"type":104,"tag":486,"props":607,"children":608},{"style":493},[609],{"type":110,"value":473},{"type":104,"tag":486,"props":611,"children":612},{"style":493},[613],{"type":110,"value":614}," '",{"type":104,"tag":486,"props":616,"children":617},{"style":527},[618],{"type":110,"value":555},{"type":104,"tag":486,"props":620,"children":621},{"style":493},[622],{"type":110,"value":623},"'",{"type":104,"tag":486,"props":625,"children":626},{"style":493},[627],{"type":110,"value":628},",",{"type":104,"tag":486,"props":630,"children":632},{"style":631},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[633],{"type":110,"value":634}," \u002F\u002F Bun swaps in when bunVersion is set\n",{"type":104,"tag":486,"props":636,"children":637},{"class":488,"line":538},[638],{"type":104,"tag":486,"props":639,"children":640},{"style":493},[641],{"type":110,"value":642},"};\n",{"type":104,"tag":113,"props":644,"children":645},{},[646],{"type":110,"value":647},"Bun reduces average latency by ~28% in CPU-bound workloads. Currently in Public Beta — supports Next.js, Express, Hono, and Nitro.",{"type":104,"tag":119,"props":649,"children":651},{"id":650},"basic-example",[652],{"type":110,"value":653},"Basic Example",{"type":104,"tag":475,"props":655,"children":657},{"className":560,"code":656,"language":562,"meta":480,"style":480},"\u002F\u002F middleware.ts (project root)\nimport { geolocation, rewrite } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request) {\n  const { country } = geolocation(request);\n  const url = new URL(request.url);\n  url.pathname = country === 'US' ? '\u002Fus' + url.pathname : '\u002Fintl' + url.pathname;\n  return rewrite(url);\n}\n\nexport const config = {\n  runtime: 'edge', \u002F\u002F 'edge' (default) | 'nodejs'\n};\n",[658],{"type":104,"tag":161,"props":659,"children":660},{"__ignoreMap":480},[661,669,724,733,786,833,885,1002,1031,1039,1047,1071,1105],{"type":104,"tag":486,"props":662,"children":663},{"class":488,"line":489},[664],{"type":104,"tag":486,"props":665,"children":666},{"style":631},[667],{"type":110,"value":668},"\u002F\u002F middleware.ts (project root)\n",{"type":104,"tag":486,"props":670,"children":671},{"class":488,"line":499},[672,677,682,687,691,696,701,706,710,715,719],{"type":104,"tag":486,"props":673,"children":674},{"style":572},[675],{"type":110,"value":676},"import",{"type":104,"tag":486,"props":678,"children":679},{"style":493},[680],{"type":110,"value":681}," {",{"type":104,"tag":486,"props":683,"children":684},{"style":583},[685],{"type":110,"value":686}," geolocation",{"type":104,"tag":486,"props":688,"children":689},{"style":493},[690],{"type":110,"value":628},{"type":104,"tag":486,"props":692,"children":693},{"style":583},[694],{"type":110,"value":695}," rewrite",{"type":104,"tag":486,"props":697,"children":698},{"style":493},[699],{"type":110,"value":700}," }",{"type":104,"tag":486,"props":702,"children":703},{"style":572},[704],{"type":110,"value":705}," from",{"type":104,"tag":486,"props":707,"children":708},{"style":493},[709],{"type":110,"value":614},{"type":104,"tag":486,"props":711,"children":712},{"style":527},[713],{"type":110,"value":714},"@vercel\u002Ffunctions",{"type":104,"tag":486,"props":716,"children":717},{"style":493},[718],{"type":110,"value":623},{"type":104,"tag":486,"props":720,"children":721},{"style":493},[722],{"type":110,"value":723},";\n",{"type":104,"tag":486,"props":725,"children":726},{"class":488,"line":538},[727],{"type":104,"tag":486,"props":728,"children":730},{"emptyLinePlaceholder":729},true,[731],{"type":110,"value":732},"\n",{"type":104,"tag":486,"props":734,"children":736},{"class":488,"line":735},4,[737,741,746,751,757,762,768,772,778,782],{"type":104,"tag":486,"props":738,"children":739},{"style":572},[740],{"type":110,"value":575},{"type":104,"tag":486,"props":742,"children":743},{"style":572},[744],{"type":110,"value":745}," default",{"type":104,"tag":486,"props":747,"children":748},{"style":508},[749],{"type":110,"value":750}," function",{"type":104,"tag":486,"props":752,"children":754},{"style":753},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[755],{"type":110,"value":756}," middleware",{"type":104,"tag":486,"props":758,"children":759},{"style":493},[760],{"type":110,"value":761},"(",{"type":104,"tag":486,"props":763,"children":765},{"style":764},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[766],{"type":110,"value":767},"request",{"type":104,"tag":486,"props":769,"children":770},{"style":493},[771],{"type":110,"value":473},{"type":104,"tag":486,"props":773,"children":775},{"style":774},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[776],{"type":110,"value":777}," Request",{"type":104,"tag":486,"props":779,"children":780},{"style":493},[781],{"type":110,"value":334},{"type":104,"tag":486,"props":783,"children":784},{"style":493},[785],{"type":110,"value":596},{"type":104,"tag":486,"props":787,"children":789},{"class":488,"line":788},5,[790,795,799,804,808,813,817,821,825,829],{"type":104,"tag":486,"props":791,"children":792},{"style":508},[793],{"type":110,"value":794},"  const",{"type":104,"tag":486,"props":796,"children":797},{"style":493},[798],{"type":110,"value":681},{"type":104,"tag":486,"props":800,"children":801},{"style":583},[802],{"type":110,"value":803}," country",{"type":104,"tag":486,"props":805,"children":806},{"style":493},[807],{"type":110,"value":700},{"type":104,"tag":486,"props":809,"children":810},{"style":493},[811],{"type":110,"value":812}," =",{"type":104,"tag":486,"props":814,"children":815},{"style":753},[816],{"type":110,"value":686},{"type":104,"tag":486,"props":818,"children":819},{"style":602},[820],{"type":110,"value":761},{"type":104,"tag":486,"props":822,"children":823},{"style":583},[824],{"type":110,"value":767},{"type":104,"tag":486,"props":826,"children":827},{"style":602},[828],{"type":110,"value":334},{"type":104,"tag":486,"props":830,"children":831},{"style":493},[832],{"type":110,"value":723},{"type":104,"tag":486,"props":834,"children":835},{"class":488,"line":37},[836,840,845,849,854,859,863,867,872,877,881],{"type":104,"tag":486,"props":837,"children":838},{"style":508},[839],{"type":110,"value":794},{"type":104,"tag":486,"props":841,"children":842},{"style":583},[843],{"type":110,"value":844}," url",{"type":104,"tag":486,"props":846,"children":847},{"style":493},[848],{"type":110,"value":812},{"type":104,"tag":486,"props":850,"children":851},{"style":493},[852],{"type":110,"value":853}," new",{"type":104,"tag":486,"props":855,"children":856},{"style":753},[857],{"type":110,"value":858}," URL",{"type":104,"tag":486,"props":860,"children":861},{"style":602},[862],{"type":110,"value":761},{"type":104,"tag":486,"props":864,"children":865},{"style":583},[866],{"type":110,"value":767},{"type":104,"tag":486,"props":868,"children":869},{"style":493},[870],{"type":110,"value":871},".",{"type":104,"tag":486,"props":873,"children":874},{"style":583},[875],{"type":110,"value":876},"url",{"type":104,"tag":486,"props":878,"children":879},{"style":602},[880],{"type":110,"value":334},{"type":104,"tag":486,"props":882,"children":883},{"style":493},[884],{"type":110,"value":723},{"type":104,"tag":486,"props":886,"children":888},{"class":488,"line":887},7,[889,894,898,903,907,911,916,920,925,929,934,938,943,947,952,956,960,964,969,973,978,982,986,990,994,998],{"type":104,"tag":486,"props":890,"children":891},{"style":583},[892],{"type":110,"value":893},"  url",{"type":104,"tag":486,"props":895,"children":896},{"style":493},[897],{"type":110,"value":871},{"type":104,"tag":486,"props":899,"children":900},{"style":583},[901],{"type":110,"value":902},"pathname",{"type":104,"tag":486,"props":904,"children":905},{"style":493},[906],{"type":110,"value":812},{"type":104,"tag":486,"props":908,"children":909},{"style":583},[910],{"type":110,"value":803},{"type":104,"tag":486,"props":912,"children":913},{"style":493},[914],{"type":110,"value":915}," ===",{"type":104,"tag":486,"props":917,"children":918},{"style":493},[919],{"type":110,"value":614},{"type":104,"tag":486,"props":921,"children":922},{"style":527},[923],{"type":110,"value":924},"US",{"type":104,"tag":486,"props":926,"children":927},{"style":493},[928],{"type":110,"value":623},{"type":104,"tag":486,"props":930,"children":931},{"style":493},[932],{"type":110,"value":933}," ?",{"type":104,"tag":486,"props":935,"children":936},{"style":493},[937],{"type":110,"value":614},{"type":104,"tag":486,"props":939,"children":940},{"style":527},[941],{"type":110,"value":942},"\u002Fus",{"type":104,"tag":486,"props":944,"children":945},{"style":493},[946],{"type":110,"value":623},{"type":104,"tag":486,"props":948,"children":949},{"style":493},[950],{"type":110,"value":951}," +",{"type":104,"tag":486,"props":953,"children":954},{"style":583},[955],{"type":110,"value":844},{"type":104,"tag":486,"props":957,"children":958},{"style":493},[959],{"type":110,"value":871},{"type":104,"tag":486,"props":961,"children":962},{"style":583},[963],{"type":110,"value":902},{"type":104,"tag":486,"props":965,"children":966},{"style":493},[967],{"type":110,"value":968}," :",{"type":104,"tag":486,"props":970,"children":971},{"style":493},[972],{"type":110,"value":614},{"type":104,"tag":486,"props":974,"children":975},{"style":527},[976],{"type":110,"value":977},"\u002Fintl",{"type":104,"tag":486,"props":979,"children":980},{"style":493},[981],{"type":110,"value":623},{"type":104,"tag":486,"props":983,"children":984},{"style":493},[985],{"type":110,"value":951},{"type":104,"tag":486,"props":987,"children":988},{"style":583},[989],{"type":110,"value":844},{"type":104,"tag":486,"props":991,"children":992},{"style":493},[993],{"type":110,"value":871},{"type":104,"tag":486,"props":995,"children":996},{"style":583},[997],{"type":110,"value":902},{"type":104,"tag":486,"props":999,"children":1000},{"style":493},[1001],{"type":110,"value":723},{"type":104,"tag":486,"props":1003,"children":1005},{"class":488,"line":1004},8,[1006,1011,1015,1019,1023,1027],{"type":104,"tag":486,"props":1007,"children":1008},{"style":572},[1009],{"type":110,"value":1010},"  return",{"type":104,"tag":486,"props":1012,"children":1013},{"style":753},[1014],{"type":110,"value":695},{"type":104,"tag":486,"props":1016,"children":1017},{"style":602},[1018],{"type":110,"value":761},{"type":104,"tag":486,"props":1020,"children":1021},{"style":583},[1022],{"type":110,"value":876},{"type":104,"tag":486,"props":1024,"children":1025},{"style":602},[1026],{"type":110,"value":334},{"type":104,"tag":486,"props":1028,"children":1029},{"style":493},[1030],{"type":110,"value":723},{"type":104,"tag":486,"props":1032,"children":1034},{"class":488,"line":1033},9,[1035],{"type":104,"tag":486,"props":1036,"children":1037},{"style":493},[1038],{"type":110,"value":544},{"type":104,"tag":486,"props":1040,"children":1042},{"class":488,"line":1041},10,[1043],{"type":104,"tag":486,"props":1044,"children":1045},{"emptyLinePlaceholder":729},[1046],{"type":110,"value":732},{"type":104,"tag":486,"props":1048,"children":1050},{"class":488,"line":1049},11,[1051,1055,1059,1063,1067],{"type":104,"tag":486,"props":1052,"children":1053},{"style":572},[1054],{"type":110,"value":575},{"type":104,"tag":486,"props":1056,"children":1057},{"style":508},[1058],{"type":110,"value":580},{"type":104,"tag":486,"props":1060,"children":1061},{"style":583},[1062],{"type":110,"value":586},{"type":104,"tag":486,"props":1064,"children":1065},{"style":493},[1066],{"type":110,"value":591},{"type":104,"tag":486,"props":1068,"children":1069},{"style":493},[1070],{"type":110,"value":596},{"type":104,"tag":486,"props":1072,"children":1074},{"class":488,"line":1073},12,[1075,1079,1083,1087,1092,1096,1100],{"type":104,"tag":486,"props":1076,"children":1077},{"style":602},[1078],{"type":110,"value":605},{"type":104,"tag":486,"props":1080,"children":1081},{"style":493},[1082],{"type":110,"value":473},{"type":104,"tag":486,"props":1084,"children":1085},{"style":493},[1086],{"type":110,"value":614},{"type":104,"tag":486,"props":1088,"children":1089},{"style":527},[1090],{"type":110,"value":1091},"edge",{"type":104,"tag":486,"props":1093,"children":1094},{"style":493},[1095],{"type":110,"value":623},{"type":104,"tag":486,"props":1097,"children":1098},{"style":493},[1099],{"type":110,"value":628},{"type":104,"tag":486,"props":1101,"children":1102},{"style":631},[1103],{"type":110,"value":1104}," \u002F\u002F 'edge' (default) | 'nodejs'\n",{"type":104,"tag":486,"props":1106,"children":1108},{"class":488,"line":1107},13,[1109],{"type":104,"tag":486,"props":1110,"children":1111},{"style":493},[1112],{"type":110,"value":642},{"type":104,"tag":119,"props":1114,"children":1116},{"id":1115},"helper-methods-vercelfunctions",[1117,1119,1124],{"type":110,"value":1118},"Helper Methods (",{"type":104,"tag":161,"props":1120,"children":1122},{"className":1121},[],[1123],{"type":110,"value":714},{"type":110,"value":334},{"type":104,"tag":113,"props":1126,"children":1127},{},[1128,1130,1135],{"type":110,"value":1129},"For non-Next.js frameworks, import from ",{"type":104,"tag":161,"props":1131,"children":1133},{"className":1132},[],[1134],{"type":110,"value":714},{"type":110,"value":473},{"type":104,"tag":223,"props":1137,"children":1138},{},[1139,1155],{"type":104,"tag":227,"props":1140,"children":1141},{},[1142],{"type":104,"tag":231,"props":1143,"children":1144},{},[1145,1150],{"type":104,"tag":235,"props":1146,"children":1147},{},[1148],{"type":110,"value":1149},"Helper",{"type":104,"tag":235,"props":1151,"children":1152},{},[1153],{"type":110,"value":1154},"Purpose",{"type":104,"tag":260,"props":1156,"children":1157},{},[1158,1175,1192,1244,1261],{"type":104,"tag":231,"props":1159,"children":1160},{},[1161,1170],{"type":104,"tag":267,"props":1162,"children":1163},{},[1164],{"type":104,"tag":161,"props":1165,"children":1167},{"className":1166},[],[1168],{"type":110,"value":1169},"next()",{"type":104,"tag":267,"props":1171,"children":1172},{},[1173],{"type":110,"value":1174},"Continue middleware chain (optionally modify headers)",{"type":104,"tag":231,"props":1176,"children":1177},{},[1178,1187],{"type":104,"tag":267,"props":1179,"children":1180},{},[1181],{"type":104,"tag":161,"props":1182,"children":1184},{"className":1183},[],[1185],{"type":110,"value":1186},"rewrite(url)",{"type":104,"tag":267,"props":1188,"children":1189},{},[1190],{"type":110,"value":1191},"Transparently serve content from a different URL",{"type":104,"tag":231,"props":1193,"children":1194},{},[1195,1204],{"type":104,"tag":267,"props":1196,"children":1197},{},[1198],{"type":104,"tag":161,"props":1199,"children":1201},{"className":1200},[],[1202],{"type":110,"value":1203},"geolocation(request)",{"type":104,"tag":267,"props":1205,"children":1206},{},[1207,1209,1215,1217,1223,1224,1230,1231,1237,1238],{"type":110,"value":1208},"Get ",{"type":104,"tag":161,"props":1210,"children":1212},{"className":1211},[],[1213],{"type":110,"value":1214},"city",{"type":110,"value":1216},", ",{"type":104,"tag":161,"props":1218,"children":1220},{"className":1219},[],[1221],{"type":110,"value":1222},"country",{"type":110,"value":1216},{"type":104,"tag":161,"props":1225,"children":1227},{"className":1226},[],[1228],{"type":110,"value":1229},"latitude",{"type":110,"value":1216},{"type":104,"tag":161,"props":1232,"children":1234},{"className":1233},[],[1235],{"type":110,"value":1236},"longitude",{"type":110,"value":1216},{"type":104,"tag":161,"props":1239,"children":1241},{"className":1240},[],[1242],{"type":110,"value":1243},"region",{"type":104,"tag":231,"props":1245,"children":1246},{},[1247,1256],{"type":104,"tag":267,"props":1248,"children":1249},{},[1250],{"type":104,"tag":161,"props":1251,"children":1253},{"className":1252},[],[1254],{"type":110,"value":1255},"ipAddress(request)",{"type":104,"tag":267,"props":1257,"children":1258},{},[1259],{"type":110,"value":1260},"Get client IP address",{"type":104,"tag":231,"props":1262,"children":1263},{},[1264,1273],{"type":104,"tag":267,"props":1265,"children":1266},{},[1267],{"type":104,"tag":161,"props":1268,"children":1270},{"className":1269},[],[1271],{"type":110,"value":1272},"waitUntil(promise)",{"type":104,"tag":267,"props":1274,"children":1275},{},[1276],{"type":110,"value":1277},"Keep function running after response is sent",{"type":104,"tag":113,"props":1279,"children":1280},{},[1281,1283,1289,1291,1296,1297,1303,1304,1310,1312,1318,1319,1325,1326,1332],{"type":110,"value":1282},"For Next.js, equivalent helpers are on ",{"type":104,"tag":161,"props":1284,"children":1286},{"className":1285},[],[1287],{"type":110,"value":1288},"NextResponse",{"type":110,"value":1290}," (",{"type":104,"tag":161,"props":1292,"children":1294},{"className":1293},[],[1295],{"type":110,"value":1169},{"type":110,"value":1216},{"type":104,"tag":161,"props":1298,"children":1300},{"className":1299},[],[1301],{"type":110,"value":1302},"rewrite()",{"type":110,"value":1216},{"type":104,"tag":161,"props":1305,"children":1307},{"className":1306},[],[1308],{"type":110,"value":1309},"redirect()",{"type":110,"value":1311},") and ",{"type":104,"tag":161,"props":1313,"children":1315},{"className":1314},[],[1316],{"type":110,"value":1317},"NextRequest",{"type":110,"value":1290},{"type":104,"tag":161,"props":1320,"children":1322},{"className":1321},[],[1323],{"type":110,"value":1324},"request.geo",{"type":110,"value":1216},{"type":104,"tag":161,"props":1327,"children":1329},{"className":1328},[],[1330],{"type":110,"value":1331},"request.ip",{"type":110,"value":1333},").",{"type":104,"tag":119,"props":1335,"children":1337},{"id":1336},"matcher-configuration",[1338],{"type":110,"value":1339},"Matcher Configuration",{"type":104,"tag":113,"props":1341,"children":1342},{},[1343,1345,1350,1352,1358],{"type":110,"value":1344},"Middleware runs on ",{"type":104,"tag":131,"props":1346,"children":1347},{},[1348],{"type":110,"value":1349},"every route",{"type":110,"value":1351}," by default. Use ",{"type":104,"tag":161,"props":1353,"children":1355},{"className":1354},[],[1356],{"type":110,"value":1357},"config.matcher",{"type":110,"value":1359}," to scope it:",{"type":104,"tag":475,"props":1361,"children":1363},{"className":560,"code":1362,"language":562,"meta":480,"style":480},"\u002F\u002F Single path\nexport const config = { matcher: '\u002Fdashboard\u002F:path*' };\n\n\u002F\u002F Multiple paths\nexport const config = { matcher: ['\u002Fdashboard\u002F:path*', '\u002Fapi\u002F:path*'] };\n\n\u002F\u002F Regex: exclude static files\nexport const config = {\n  matcher: ['\u002F((?!_next\u002Fstatic|favicon.ico).*)'],\n};\n",[1364],{"type":104,"tag":161,"props":1365,"children":1366},{"__ignoreMap":480},[1367,1375,1425,1432,1440,1514,1521,1529,1552,1591],{"type":104,"tag":486,"props":1368,"children":1369},{"class":488,"line":489},[1370],{"type":104,"tag":486,"props":1371,"children":1372},{"style":631},[1373],{"type":110,"value":1374},"\u002F\u002F Single path\n",{"type":104,"tag":486,"props":1376,"children":1377},{"class":488,"line":499},[1378,1382,1386,1390,1394,1398,1403,1407,1411,1416,1420],{"type":104,"tag":486,"props":1379,"children":1380},{"style":572},[1381],{"type":110,"value":575},{"type":104,"tag":486,"props":1383,"children":1384},{"style":508},[1385],{"type":110,"value":580},{"type":104,"tag":486,"props":1387,"children":1388},{"style":583},[1389],{"type":110,"value":586},{"type":104,"tag":486,"props":1391,"children":1392},{"style":493},[1393],{"type":110,"value":591},{"type":104,"tag":486,"props":1395,"children":1396},{"style":493},[1397],{"type":110,"value":681},{"type":104,"tag":486,"props":1399,"children":1400},{"style":602},[1401],{"type":110,"value":1402}," matcher",{"type":104,"tag":486,"props":1404,"children":1405},{"style":493},[1406],{"type":110,"value":473},{"type":104,"tag":486,"props":1408,"children":1409},{"style":493},[1410],{"type":110,"value":614},{"type":104,"tag":486,"props":1412,"children":1413},{"style":527},[1414],{"type":110,"value":1415},"\u002Fdashboard\u002F:path*",{"type":104,"tag":486,"props":1417,"children":1418},{"style":493},[1419],{"type":110,"value":623},{"type":104,"tag":486,"props":1421,"children":1422},{"style":493},[1423],{"type":110,"value":1424}," };\n",{"type":104,"tag":486,"props":1426,"children":1427},{"class":488,"line":538},[1428],{"type":104,"tag":486,"props":1429,"children":1430},{"emptyLinePlaceholder":729},[1431],{"type":110,"value":732},{"type":104,"tag":486,"props":1433,"children":1434},{"class":488,"line":735},[1435],{"type":104,"tag":486,"props":1436,"children":1437},{"style":631},[1438],{"type":110,"value":1439},"\u002F\u002F Multiple paths\n",{"type":104,"tag":486,"props":1441,"children":1442},{"class":488,"line":788},[1443,1447,1451,1455,1459,1463,1467,1471,1476,1480,1484,1488,1492,1496,1501,1505,1510],{"type":104,"tag":486,"props":1444,"children":1445},{"style":572},[1446],{"type":110,"value":575},{"type":104,"tag":486,"props":1448,"children":1449},{"style":508},[1450],{"type":110,"value":580},{"type":104,"tag":486,"props":1452,"children":1453},{"style":583},[1454],{"type":110,"value":586},{"type":104,"tag":486,"props":1456,"children":1457},{"style":493},[1458],{"type":110,"value":591},{"type":104,"tag":486,"props":1460,"children":1461},{"style":493},[1462],{"type":110,"value":681},{"type":104,"tag":486,"props":1464,"children":1465},{"style":602},[1466],{"type":110,"value":1402},{"type":104,"tag":486,"props":1468,"children":1469},{"style":493},[1470],{"type":110,"value":473},{"type":104,"tag":486,"props":1472,"children":1473},{"style":583},[1474],{"type":110,"value":1475}," [",{"type":104,"tag":486,"props":1477,"children":1478},{"style":493},[1479],{"type":110,"value":623},{"type":104,"tag":486,"props":1481,"children":1482},{"style":527},[1483],{"type":110,"value":1415},{"type":104,"tag":486,"props":1485,"children":1486},{"style":493},[1487],{"type":110,"value":623},{"type":104,"tag":486,"props":1489,"children":1490},{"style":493},[1491],{"type":110,"value":628},{"type":104,"tag":486,"props":1493,"children":1494},{"style":493},[1495],{"type":110,"value":614},{"type":104,"tag":486,"props":1497,"children":1498},{"style":527},[1499],{"type":110,"value":1500},"\u002Fapi\u002F:path*",{"type":104,"tag":486,"props":1502,"children":1503},{"style":493},[1504],{"type":110,"value":623},{"type":104,"tag":486,"props":1506,"children":1507},{"style":583},[1508],{"type":110,"value":1509},"] ",{"type":104,"tag":486,"props":1511,"children":1512},{"style":493},[1513],{"type":110,"value":642},{"type":104,"tag":486,"props":1515,"children":1516},{"class":488,"line":37},[1517],{"type":104,"tag":486,"props":1518,"children":1519},{"emptyLinePlaceholder":729},[1520],{"type":110,"value":732},{"type":104,"tag":486,"props":1522,"children":1523},{"class":488,"line":887},[1524],{"type":104,"tag":486,"props":1525,"children":1526},{"style":631},[1527],{"type":110,"value":1528},"\u002F\u002F Regex: exclude static files\n",{"type":104,"tag":486,"props":1530,"children":1531},{"class":488,"line":1004},[1532,1536,1540,1544,1548],{"type":104,"tag":486,"props":1533,"children":1534},{"style":572},[1535],{"type":110,"value":575},{"type":104,"tag":486,"props":1537,"children":1538},{"style":508},[1539],{"type":110,"value":580},{"type":104,"tag":486,"props":1541,"children":1542},{"style":583},[1543],{"type":110,"value":586},{"type":104,"tag":486,"props":1545,"children":1546},{"style":493},[1547],{"type":110,"value":591},{"type":104,"tag":486,"props":1549,"children":1550},{"style":493},[1551],{"type":110,"value":596},{"type":104,"tag":486,"props":1553,"children":1554},{"class":488,"line":1033},[1555,1560,1564,1568,1572,1577,1581,1586],{"type":104,"tag":486,"props":1556,"children":1557},{"style":602},[1558],{"type":110,"value":1559},"  matcher",{"type":104,"tag":486,"props":1561,"children":1562},{"style":493},[1563],{"type":110,"value":473},{"type":104,"tag":486,"props":1565,"children":1566},{"style":583},[1567],{"type":110,"value":1475},{"type":104,"tag":486,"props":1569,"children":1570},{"style":493},[1571],{"type":110,"value":623},{"type":104,"tag":486,"props":1573,"children":1574},{"style":527},[1575],{"type":110,"value":1576},"\u002F((?!_next\u002Fstatic|favicon.ico).*)",{"type":104,"tag":486,"props":1578,"children":1579},{"style":493},[1580],{"type":110,"value":623},{"type":104,"tag":486,"props":1582,"children":1583},{"style":583},[1584],{"type":110,"value":1585},"]",{"type":104,"tag":486,"props":1587,"children":1588},{"style":493},[1589],{"type":110,"value":1590},",\n",{"type":104,"tag":486,"props":1592,"children":1593},{"class":488,"line":1041},[1594],{"type":104,"tag":486,"props":1595,"children":1596},{"style":493},[1597],{"type":110,"value":642},{"type":104,"tag":113,"props":1599,"children":1600},{},[1601,1606,1608,1614],{"type":104,"tag":131,"props":1602,"children":1603},{},[1604],{"type":110,"value":1605},"Tip",{"type":110,"value":1607},": Using ",{"type":104,"tag":161,"props":1609,"children":1611},{"className":1610},[],[1612],{"type":110,"value":1613},"matcher",{"type":110,"value":1615}," is preferred — unmatched paths skip middleware invocation entirely (saves compute).",{"type":104,"tag":119,"props":1617,"children":1619},{"id":1618},"common-patterns",[1620],{"type":110,"value":1621},"Common Patterns",{"type":104,"tag":1623,"props":1624,"children":1626},"h3",{"id":1625},"ip-based-header-injection",[1627],{"type":110,"value":1628},"IP-Based Header Injection",{"type":104,"tag":475,"props":1630,"children":1632},{"className":560,"code":1631,"language":562,"meta":480,"style":480},"import { ipAddress, next } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request) {\n  return next({ headers: { 'x-real-ip': ipAddress(request) || 'unknown' } });\n}\n",[1633],{"type":104,"tag":161,"props":1634,"children":1635},{"__ignoreMap":480},[1636,1685,1692,1735,1836],{"type":104,"tag":486,"props":1637,"children":1638},{"class":488,"line":489},[1639,1643,1647,1652,1656,1661,1665,1669,1673,1677,1681],{"type":104,"tag":486,"props":1640,"children":1641},{"style":572},[1642],{"type":110,"value":676},{"type":104,"tag":486,"props":1644,"children":1645},{"style":493},[1646],{"type":110,"value":681},{"type":104,"tag":486,"props":1648,"children":1649},{"style":583},[1650],{"type":110,"value":1651}," ipAddress",{"type":104,"tag":486,"props":1653,"children":1654},{"style":493},[1655],{"type":110,"value":628},{"type":104,"tag":486,"props":1657,"children":1658},{"style":583},[1659],{"type":110,"value":1660}," next",{"type":104,"tag":486,"props":1662,"children":1663},{"style":493},[1664],{"type":110,"value":700},{"type":104,"tag":486,"props":1666,"children":1667},{"style":572},[1668],{"type":110,"value":705},{"type":104,"tag":486,"props":1670,"children":1671},{"style":493},[1672],{"type":110,"value":614},{"type":104,"tag":486,"props":1674,"children":1675},{"style":527},[1676],{"type":110,"value":714},{"type":104,"tag":486,"props":1678,"children":1679},{"style":493},[1680],{"type":110,"value":623},{"type":104,"tag":486,"props":1682,"children":1683},{"style":493},[1684],{"type":110,"value":723},{"type":104,"tag":486,"props":1686,"children":1687},{"class":488,"line":499},[1688],{"type":104,"tag":486,"props":1689,"children":1690},{"emptyLinePlaceholder":729},[1691],{"type":110,"value":732},{"type":104,"tag":486,"props":1693,"children":1694},{"class":488,"line":538},[1695,1699,1703,1707,1711,1715,1719,1723,1727,1731],{"type":104,"tag":486,"props":1696,"children":1697},{"style":572},[1698],{"type":110,"value":575},{"type":104,"tag":486,"props":1700,"children":1701},{"style":572},[1702],{"type":110,"value":745},{"type":104,"tag":486,"props":1704,"children":1705},{"style":508},[1706],{"type":110,"value":750},{"type":104,"tag":486,"props":1708,"children":1709},{"style":753},[1710],{"type":110,"value":756},{"type":104,"tag":486,"props":1712,"children":1713},{"style":493},[1714],{"type":110,"value":761},{"type":104,"tag":486,"props":1716,"children":1717},{"style":764},[1718],{"type":110,"value":767},{"type":104,"tag":486,"props":1720,"children":1721},{"style":493},[1722],{"type":110,"value":473},{"type":104,"tag":486,"props":1724,"children":1725},{"style":774},[1726],{"type":110,"value":777},{"type":104,"tag":486,"props":1728,"children":1729},{"style":493},[1730],{"type":110,"value":334},{"type":104,"tag":486,"props":1732,"children":1733},{"style":493},[1734],{"type":110,"value":596},{"type":104,"tag":486,"props":1736,"children":1737},{"class":488,"line":735},[1738,1742,1746,1750,1755,1760,1764,1768,1772,1777,1781,1785,1789,1793,1797,1802,1807,1811,1816,1820,1824,1828,1832],{"type":104,"tag":486,"props":1739,"children":1740},{"style":572},[1741],{"type":110,"value":1010},{"type":104,"tag":486,"props":1743,"children":1744},{"style":753},[1745],{"type":110,"value":1660},{"type":104,"tag":486,"props":1747,"children":1748},{"style":602},[1749],{"type":110,"value":761},{"type":104,"tag":486,"props":1751,"children":1752},{"style":493},[1753],{"type":110,"value":1754},"{",{"type":104,"tag":486,"props":1756,"children":1757},{"style":602},[1758],{"type":110,"value":1759}," headers",{"type":104,"tag":486,"props":1761,"children":1762},{"style":493},[1763],{"type":110,"value":473},{"type":104,"tag":486,"props":1765,"children":1766},{"style":493},[1767],{"type":110,"value":681},{"type":104,"tag":486,"props":1769,"children":1770},{"style":493},[1771],{"type":110,"value":614},{"type":104,"tag":486,"props":1773,"children":1774},{"style":602},[1775],{"type":110,"value":1776},"x-real-ip",{"type":104,"tag":486,"props":1778,"children":1779},{"style":493},[1780],{"type":110,"value":623},{"type":104,"tag":486,"props":1782,"children":1783},{"style":493},[1784],{"type":110,"value":473},{"type":104,"tag":486,"props":1786,"children":1787},{"style":753},[1788],{"type":110,"value":1651},{"type":104,"tag":486,"props":1790,"children":1791},{"style":602},[1792],{"type":110,"value":761},{"type":104,"tag":486,"props":1794,"children":1795},{"style":583},[1796],{"type":110,"value":767},{"type":104,"tag":486,"props":1798,"children":1799},{"style":602},[1800],{"type":110,"value":1801},") ",{"type":104,"tag":486,"props":1803,"children":1804},{"style":493},[1805],{"type":110,"value":1806},"||",{"type":104,"tag":486,"props":1808,"children":1809},{"style":493},[1810],{"type":110,"value":614},{"type":104,"tag":486,"props":1812,"children":1813},{"style":527},[1814],{"type":110,"value":1815},"unknown",{"type":104,"tag":486,"props":1817,"children":1818},{"style":493},[1819],{"type":110,"value":623},{"type":104,"tag":486,"props":1821,"children":1822},{"style":493},[1823],{"type":110,"value":700},{"type":104,"tag":486,"props":1825,"children":1826},{"style":493},[1827],{"type":110,"value":700},{"type":104,"tag":486,"props":1829,"children":1830},{"style":602},[1831],{"type":110,"value":334},{"type":104,"tag":486,"props":1833,"children":1834},{"style":493},[1835],{"type":110,"value":723},{"type":104,"tag":486,"props":1837,"children":1838},{"class":488,"line":788},[1839],{"type":104,"tag":486,"props":1840,"children":1841},{"style":493},[1842],{"type":110,"value":544},{"type":104,"tag":1623,"props":1844,"children":1846},{"id":1845},"ab-testing-via-edge-config",[1847],{"type":110,"value":1848},"A\u002FB Testing via Edge Config",{"type":104,"tag":475,"props":1850,"children":1852},{"className":560,"code":1851,"language":562,"meta":480,"style":480},"import { get } from '@vercel\u002Fedge-config';\nimport { rewrite } from '@vercel\u002Ffunctions';\n\nexport default async function middleware(request: Request) {\n  const variant = await get('experiment-homepage'); \u002F\u002F \u003C1ms read\n  const url = new URL(request.url);\n  url.pathname = variant === 'B' ? '\u002Fhome-b' : '\u002Fhome-a';\n  return rewrite(url);\n}\n",[1853],{"type":104,"tag":161,"props":1854,"children":1855},{"__ignoreMap":480},[1856,1897,1936,1943,1991,2047,2094,2172,2199],{"type":104,"tag":486,"props":1857,"children":1858},{"class":488,"line":489},[1859,1863,1867,1872,1876,1880,1884,1889,1893],{"type":104,"tag":486,"props":1860,"children":1861},{"style":572},[1862],{"type":110,"value":676},{"type":104,"tag":486,"props":1864,"children":1865},{"style":493},[1866],{"type":110,"value":681},{"type":104,"tag":486,"props":1868,"children":1869},{"style":583},[1870],{"type":110,"value":1871}," get",{"type":104,"tag":486,"props":1873,"children":1874},{"style":493},[1875],{"type":110,"value":700},{"type":104,"tag":486,"props":1877,"children":1878},{"style":572},[1879],{"type":110,"value":705},{"type":104,"tag":486,"props":1881,"children":1882},{"style":493},[1883],{"type":110,"value":614},{"type":104,"tag":486,"props":1885,"children":1886},{"style":527},[1887],{"type":110,"value":1888},"@vercel\u002Fedge-config",{"type":104,"tag":486,"props":1890,"children":1891},{"style":493},[1892],{"type":110,"value":623},{"type":104,"tag":486,"props":1894,"children":1895},{"style":493},[1896],{"type":110,"value":723},{"type":104,"tag":486,"props":1898,"children":1899},{"class":488,"line":499},[1900,1904,1908,1912,1916,1920,1924,1928,1932],{"type":104,"tag":486,"props":1901,"children":1902},{"style":572},[1903],{"type":110,"value":676},{"type":104,"tag":486,"props":1905,"children":1906},{"style":493},[1907],{"type":110,"value":681},{"type":104,"tag":486,"props":1909,"children":1910},{"style":583},[1911],{"type":110,"value":695},{"type":104,"tag":486,"props":1913,"children":1914},{"style":493},[1915],{"type":110,"value":700},{"type":104,"tag":486,"props":1917,"children":1918},{"style":572},[1919],{"type":110,"value":705},{"type":104,"tag":486,"props":1921,"children":1922},{"style":493},[1923],{"type":110,"value":614},{"type":104,"tag":486,"props":1925,"children":1926},{"style":527},[1927],{"type":110,"value":714},{"type":104,"tag":486,"props":1929,"children":1930},{"style":493},[1931],{"type":110,"value":623},{"type":104,"tag":486,"props":1933,"children":1934},{"style":493},[1935],{"type":110,"value":723},{"type":104,"tag":486,"props":1937,"children":1938},{"class":488,"line":538},[1939],{"type":104,"tag":486,"props":1940,"children":1941},{"emptyLinePlaceholder":729},[1942],{"type":110,"value":732},{"type":104,"tag":486,"props":1944,"children":1945},{"class":488,"line":735},[1946,1950,1954,1959,1963,1967,1971,1975,1979,1983,1987],{"type":104,"tag":486,"props":1947,"children":1948},{"style":572},[1949],{"type":110,"value":575},{"type":104,"tag":486,"props":1951,"children":1952},{"style":572},[1953],{"type":110,"value":745},{"type":104,"tag":486,"props":1955,"children":1956},{"style":508},[1957],{"type":110,"value":1958}," async",{"type":104,"tag":486,"props":1960,"children":1961},{"style":508},[1962],{"type":110,"value":750},{"type":104,"tag":486,"props":1964,"children":1965},{"style":753},[1966],{"type":110,"value":756},{"type":104,"tag":486,"props":1968,"children":1969},{"style":493},[1970],{"type":110,"value":761},{"type":104,"tag":486,"props":1972,"children":1973},{"style":764},[1974],{"type":110,"value":767},{"type":104,"tag":486,"props":1976,"children":1977},{"style":493},[1978],{"type":110,"value":473},{"type":104,"tag":486,"props":1980,"children":1981},{"style":774},[1982],{"type":110,"value":777},{"type":104,"tag":486,"props":1984,"children":1985},{"style":493},[1986],{"type":110,"value":334},{"type":104,"tag":486,"props":1988,"children":1989},{"style":493},[1990],{"type":110,"value":596},{"type":104,"tag":486,"props":1992,"children":1993},{"class":488,"line":788},[1994,1998,2003,2007,2012,2016,2020,2024,2029,2033,2037,2042],{"type":104,"tag":486,"props":1995,"children":1996},{"style":508},[1997],{"type":110,"value":794},{"type":104,"tag":486,"props":1999,"children":2000},{"style":583},[2001],{"type":110,"value":2002}," variant",{"type":104,"tag":486,"props":2004,"children":2005},{"style":493},[2006],{"type":110,"value":812},{"type":104,"tag":486,"props":2008,"children":2009},{"style":572},[2010],{"type":110,"value":2011}," await",{"type":104,"tag":486,"props":2013,"children":2014},{"style":753},[2015],{"type":110,"value":1871},{"type":104,"tag":486,"props":2017,"children":2018},{"style":602},[2019],{"type":110,"value":761},{"type":104,"tag":486,"props":2021,"children":2022},{"style":493},[2023],{"type":110,"value":623},{"type":104,"tag":486,"props":2025,"children":2026},{"style":527},[2027],{"type":110,"value":2028},"experiment-homepage",{"type":104,"tag":486,"props":2030,"children":2031},{"style":493},[2032],{"type":110,"value":623},{"type":104,"tag":486,"props":2034,"children":2035},{"style":602},[2036],{"type":110,"value":334},{"type":104,"tag":486,"props":2038,"children":2039},{"style":493},[2040],{"type":110,"value":2041},";",{"type":104,"tag":486,"props":2043,"children":2044},{"style":631},[2045],{"type":110,"value":2046}," \u002F\u002F \u003C1ms read\n",{"type":104,"tag":486,"props":2048,"children":2049},{"class":488,"line":37},[2050,2054,2058,2062,2066,2070,2074,2078,2082,2086,2090],{"type":104,"tag":486,"props":2051,"children":2052},{"style":508},[2053],{"type":110,"value":794},{"type":104,"tag":486,"props":2055,"children":2056},{"style":583},[2057],{"type":110,"value":844},{"type":104,"tag":486,"props":2059,"children":2060},{"style":493},[2061],{"type":110,"value":812},{"type":104,"tag":486,"props":2063,"children":2064},{"style":493},[2065],{"type":110,"value":853},{"type":104,"tag":486,"props":2067,"children":2068},{"style":753},[2069],{"type":110,"value":858},{"type":104,"tag":486,"props":2071,"children":2072},{"style":602},[2073],{"type":110,"value":761},{"type":104,"tag":486,"props":2075,"children":2076},{"style":583},[2077],{"type":110,"value":767},{"type":104,"tag":486,"props":2079,"children":2080},{"style":493},[2081],{"type":110,"value":871},{"type":104,"tag":486,"props":2083,"children":2084},{"style":583},[2085],{"type":110,"value":876},{"type":104,"tag":486,"props":2087,"children":2088},{"style":602},[2089],{"type":110,"value":334},{"type":104,"tag":486,"props":2091,"children":2092},{"style":493},[2093],{"type":110,"value":723},{"type":104,"tag":486,"props":2095,"children":2096},{"class":488,"line":887},[2097,2101,2105,2109,2113,2117,2121,2125,2130,2134,2138,2142,2147,2151,2155,2159,2164,2168],{"type":104,"tag":486,"props":2098,"children":2099},{"style":583},[2100],{"type":110,"value":893},{"type":104,"tag":486,"props":2102,"children":2103},{"style":493},[2104],{"type":110,"value":871},{"type":104,"tag":486,"props":2106,"children":2107},{"style":583},[2108],{"type":110,"value":902},{"type":104,"tag":486,"props":2110,"children":2111},{"style":493},[2112],{"type":110,"value":812},{"type":104,"tag":486,"props":2114,"children":2115},{"style":583},[2116],{"type":110,"value":2002},{"type":104,"tag":486,"props":2118,"children":2119},{"style":493},[2120],{"type":110,"value":915},{"type":104,"tag":486,"props":2122,"children":2123},{"style":493},[2124],{"type":110,"value":614},{"type":104,"tag":486,"props":2126,"children":2127},{"style":527},[2128],{"type":110,"value":2129},"B",{"type":104,"tag":486,"props":2131,"children":2132},{"style":493},[2133],{"type":110,"value":623},{"type":104,"tag":486,"props":2135,"children":2136},{"style":493},[2137],{"type":110,"value":933},{"type":104,"tag":486,"props":2139,"children":2140},{"style":493},[2141],{"type":110,"value":614},{"type":104,"tag":486,"props":2143,"children":2144},{"style":527},[2145],{"type":110,"value":2146},"\u002Fhome-b",{"type":104,"tag":486,"props":2148,"children":2149},{"style":493},[2150],{"type":110,"value":623},{"type":104,"tag":486,"props":2152,"children":2153},{"style":493},[2154],{"type":110,"value":968},{"type":104,"tag":486,"props":2156,"children":2157},{"style":493},[2158],{"type":110,"value":614},{"type":104,"tag":486,"props":2160,"children":2161},{"style":527},[2162],{"type":110,"value":2163},"\u002Fhome-a",{"type":104,"tag":486,"props":2165,"children":2166},{"style":493},[2167],{"type":110,"value":623},{"type":104,"tag":486,"props":2169,"children":2170},{"style":493},[2171],{"type":110,"value":723},{"type":104,"tag":486,"props":2173,"children":2174},{"class":488,"line":1004},[2175,2179,2183,2187,2191,2195],{"type":104,"tag":486,"props":2176,"children":2177},{"style":572},[2178],{"type":110,"value":1010},{"type":104,"tag":486,"props":2180,"children":2181},{"style":753},[2182],{"type":110,"value":695},{"type":104,"tag":486,"props":2184,"children":2185},{"style":602},[2186],{"type":110,"value":761},{"type":104,"tag":486,"props":2188,"children":2189},{"style":583},[2190],{"type":110,"value":876},{"type":104,"tag":486,"props":2192,"children":2193},{"style":602},[2194],{"type":110,"value":334},{"type":104,"tag":486,"props":2196,"children":2197},{"style":493},[2198],{"type":110,"value":723},{"type":104,"tag":486,"props":2200,"children":2201},{"class":488,"line":1033},[2202],{"type":104,"tag":486,"props":2203,"children":2204},{"style":493},[2205],{"type":110,"value":544},{"type":104,"tag":1623,"props":2207,"children":2209},{"id":2208},"background-processing",[2210],{"type":110,"value":2211},"Background Processing",{"type":104,"tag":475,"props":2213,"children":2215},{"className":560,"code":2214,"language":562,"meta":480,"style":480},"import type { RequestContext } from '@vercel\u002Ffunctions';\n\nexport default function middleware(request: Request, context: RequestContext) {\n  context.waitUntil(\n    fetch('https:\u002F\u002Fanalytics.example.com\u002Flog', { method: 'POST', body: request.url })\n  );\n  return new Response('OK');\n}\n",[2216],{"type":104,"tag":161,"props":2217,"children":2218},{"__ignoreMap":480},[2219,2264,2271,2331,2353,2443,2455,2496],{"type":104,"tag":486,"props":2220,"children":2221},{"class":488,"line":489},[2222,2226,2231,2235,2240,2244,2248,2252,2256,2260],{"type":104,"tag":486,"props":2223,"children":2224},{"style":572},[2225],{"type":110,"value":676},{"type":104,"tag":486,"props":2227,"children":2228},{"style":572},[2229],{"type":110,"value":2230}," type",{"type":104,"tag":486,"props":2232,"children":2233},{"style":493},[2234],{"type":110,"value":681},{"type":104,"tag":486,"props":2236,"children":2237},{"style":583},[2238],{"type":110,"value":2239}," RequestContext",{"type":104,"tag":486,"props":2241,"children":2242},{"style":493},[2243],{"type":110,"value":700},{"type":104,"tag":486,"props":2245,"children":2246},{"style":572},[2247],{"type":110,"value":705},{"type":104,"tag":486,"props":2249,"children":2250},{"style":493},[2251],{"type":110,"value":614},{"type":104,"tag":486,"props":2253,"children":2254},{"style":527},[2255],{"type":110,"value":714},{"type":104,"tag":486,"props":2257,"children":2258},{"style":493},[2259],{"type":110,"value":623},{"type":104,"tag":486,"props":2261,"children":2262},{"style":493},[2263],{"type":110,"value":723},{"type":104,"tag":486,"props":2265,"children":2266},{"class":488,"line":499},[2267],{"type":104,"tag":486,"props":2268,"children":2269},{"emptyLinePlaceholder":729},[2270],{"type":110,"value":732},{"type":104,"tag":486,"props":2272,"children":2273},{"class":488,"line":538},[2274,2278,2282,2286,2290,2294,2298,2302,2306,2310,2315,2319,2323,2327],{"type":104,"tag":486,"props":2275,"children":2276},{"style":572},[2277],{"type":110,"value":575},{"type":104,"tag":486,"props":2279,"children":2280},{"style":572},[2281],{"type":110,"value":745},{"type":104,"tag":486,"props":2283,"children":2284},{"style":508},[2285],{"type":110,"value":750},{"type":104,"tag":486,"props":2287,"children":2288},{"style":753},[2289],{"type":110,"value":756},{"type":104,"tag":486,"props":2291,"children":2292},{"style":493},[2293],{"type":110,"value":761},{"type":104,"tag":486,"props":2295,"children":2296},{"style":764},[2297],{"type":110,"value":767},{"type":104,"tag":486,"props":2299,"children":2300},{"style":493},[2301],{"type":110,"value":473},{"type":104,"tag":486,"props":2303,"children":2304},{"style":774},[2305],{"type":110,"value":777},{"type":104,"tag":486,"props":2307,"children":2308},{"style":493},[2309],{"type":110,"value":628},{"type":104,"tag":486,"props":2311,"children":2312},{"style":764},[2313],{"type":110,"value":2314}," context",{"type":104,"tag":486,"props":2316,"children":2317},{"style":493},[2318],{"type":110,"value":473},{"type":104,"tag":486,"props":2320,"children":2321},{"style":774},[2322],{"type":110,"value":2239},{"type":104,"tag":486,"props":2324,"children":2325},{"style":493},[2326],{"type":110,"value":334},{"type":104,"tag":486,"props":2328,"children":2329},{"style":493},[2330],{"type":110,"value":596},{"type":104,"tag":486,"props":2332,"children":2333},{"class":488,"line":735},[2334,2339,2343,2348],{"type":104,"tag":486,"props":2335,"children":2336},{"style":583},[2337],{"type":110,"value":2338},"  context",{"type":104,"tag":486,"props":2340,"children":2341},{"style":493},[2342],{"type":110,"value":871},{"type":104,"tag":486,"props":2344,"children":2345},{"style":753},[2346],{"type":110,"value":2347},"waitUntil",{"type":104,"tag":486,"props":2349,"children":2350},{"style":602},[2351],{"type":110,"value":2352},"(\n",{"type":104,"tag":486,"props":2354,"children":2355},{"class":488,"line":788},[2356,2361,2365,2369,2374,2378,2382,2386,2391,2395,2399,2404,2408,2412,2417,2421,2426,2430,2434,2438],{"type":104,"tag":486,"props":2357,"children":2358},{"style":753},[2359],{"type":110,"value":2360},"    fetch",{"type":104,"tag":486,"props":2362,"children":2363},{"style":602},[2364],{"type":110,"value":761},{"type":104,"tag":486,"props":2366,"children":2367},{"style":493},[2368],{"type":110,"value":623},{"type":104,"tag":486,"props":2370,"children":2371},{"style":527},[2372],{"type":110,"value":2373},"https:\u002F\u002Fanalytics.example.com\u002Flog",{"type":104,"tag":486,"props":2375,"children":2376},{"style":493},[2377],{"type":110,"value":623},{"type":104,"tag":486,"props":2379,"children":2380},{"style":493},[2381],{"type":110,"value":628},{"type":104,"tag":486,"props":2383,"children":2384},{"style":493},[2385],{"type":110,"value":681},{"type":104,"tag":486,"props":2387,"children":2388},{"style":602},[2389],{"type":110,"value":2390}," method",{"type":104,"tag":486,"props":2392,"children":2393},{"style":493},[2394],{"type":110,"value":473},{"type":104,"tag":486,"props":2396,"children":2397},{"style":493},[2398],{"type":110,"value":614},{"type":104,"tag":486,"props":2400,"children":2401},{"style":527},[2402],{"type":110,"value":2403},"POST",{"type":104,"tag":486,"props":2405,"children":2406},{"style":493},[2407],{"type":110,"value":623},{"type":104,"tag":486,"props":2409,"children":2410},{"style":493},[2411],{"type":110,"value":628},{"type":104,"tag":486,"props":2413,"children":2414},{"style":602},[2415],{"type":110,"value":2416}," body",{"type":104,"tag":486,"props":2418,"children":2419},{"style":493},[2420],{"type":110,"value":473},{"type":104,"tag":486,"props":2422,"children":2423},{"style":583},[2424],{"type":110,"value":2425}," request",{"type":104,"tag":486,"props":2427,"children":2428},{"style":493},[2429],{"type":110,"value":871},{"type":104,"tag":486,"props":2431,"children":2432},{"style":583},[2433],{"type":110,"value":876},{"type":104,"tag":486,"props":2435,"children":2436},{"style":493},[2437],{"type":110,"value":700},{"type":104,"tag":486,"props":2439,"children":2440},{"style":602},[2441],{"type":110,"value":2442},")\n",{"type":104,"tag":486,"props":2444,"children":2445},{"class":488,"line":37},[2446,2451],{"type":104,"tag":486,"props":2447,"children":2448},{"style":602},[2449],{"type":110,"value":2450},"  )",{"type":104,"tag":486,"props":2452,"children":2453},{"style":493},[2454],{"type":110,"value":723},{"type":104,"tag":486,"props":2456,"children":2457},{"class":488,"line":887},[2458,2462,2466,2471,2475,2479,2484,2488,2492],{"type":104,"tag":486,"props":2459,"children":2460},{"style":572},[2461],{"type":110,"value":1010},{"type":104,"tag":486,"props":2463,"children":2464},{"style":493},[2465],{"type":110,"value":853},{"type":104,"tag":486,"props":2467,"children":2468},{"style":753},[2469],{"type":110,"value":2470}," Response",{"type":104,"tag":486,"props":2472,"children":2473},{"style":602},[2474],{"type":110,"value":761},{"type":104,"tag":486,"props":2476,"children":2477},{"style":493},[2478],{"type":110,"value":623},{"type":104,"tag":486,"props":2480,"children":2481},{"style":527},[2482],{"type":110,"value":2483},"OK",{"type":104,"tag":486,"props":2485,"children":2486},{"style":493},[2487],{"type":110,"value":623},{"type":104,"tag":486,"props":2489,"children":2490},{"style":602},[2491],{"type":110,"value":334},{"type":104,"tag":486,"props":2493,"children":2494},{"style":493},[2495],{"type":110,"value":723},{"type":104,"tag":486,"props":2497,"children":2498},{"class":488,"line":1004},[2499],{"type":104,"tag":486,"props":2500,"children":2501},{"style":493},[2502],{"type":110,"value":544},{"type":104,"tag":119,"props":2504,"children":2506},{"id":2505},"request-limits",[2507],{"type":110,"value":2508},"Request Limits",{"type":104,"tag":223,"props":2510,"children":2511},{},[2512,2528],{"type":104,"tag":227,"props":2513,"children":2514},{},[2515],{"type":104,"tag":231,"props":2516,"children":2517},{},[2518,2523],{"type":104,"tag":235,"props":2519,"children":2520},{},[2521],{"type":110,"value":2522},"Limit",{"type":104,"tag":235,"props":2524,"children":2525},{},[2526],{"type":110,"value":2527},"Value",{"type":104,"tag":260,"props":2529,"children":2530},{},[2531,2544,2557],{"type":104,"tag":231,"props":2532,"children":2533},{},[2534,2539],{"type":104,"tag":267,"props":2535,"children":2536},{},[2537],{"type":110,"value":2538},"Max URL length",{"type":104,"tag":267,"props":2540,"children":2541},{},[2542],{"type":110,"value":2543},"14 KB",{"type":104,"tag":231,"props":2545,"children":2546},{},[2547,2552],{"type":104,"tag":267,"props":2548,"children":2549},{},[2550],{"type":110,"value":2551},"Max request body",{"type":104,"tag":267,"props":2553,"children":2554},{},[2555],{"type":110,"value":2556},"4 MB",{"type":104,"tag":231,"props":2558,"children":2559},{},[2560,2565],{"type":104,"tag":267,"props":2561,"children":2562},{},[2563],{"type":110,"value":2564},"Max request headers",{"type":104,"tag":267,"props":2566,"children":2567},{},[2568],{"type":110,"value":2569},"64 headers \u002F 16 KB total",{"type":104,"tag":119,"props":2571,"children":2573},{"id":2572},"three-cdn-routing-mechanisms",[2574],{"type":110,"value":2575},"Three CDN Routing Mechanisms",{"type":104,"tag":113,"props":2577,"children":2578},{},[2579],{"type":110,"value":2580},"Vercel's CDN supports three routing mechanisms, evaluated in this order:",{"type":104,"tag":223,"props":2582,"children":2583},{},[2584,2614],{"type":104,"tag":227,"props":2585,"children":2586},{},[2587],{"type":104,"tag":231,"props":2588,"children":2589},{},[2590,2595,2600,2604,2609],{"type":104,"tag":235,"props":2591,"children":2592},{},[2593],{"type":110,"value":2594},"Order",{"type":104,"tag":235,"props":2596,"children":2597},{},[2598],{"type":110,"value":2599},"Mechanism",{"type":104,"tag":235,"props":2601,"children":2602},{},[2603],{"type":110,"value":253},{"type":104,"tag":235,"props":2605,"children":2606},{},[2607],{"type":110,"value":2608},"Deploy Required",{"type":104,"tag":235,"props":2610,"children":2611},{},[2612],{"type":110,"value":2613},"How to Configure",{"type":104,"tag":260,"props":2615,"children":2616},{},[2617,2648,2679],{"type":104,"tag":231,"props":2618,"children":2619},{},[2620,2625,2633,2638,2643],{"type":104,"tag":267,"props":2621,"children":2622},{},[2623],{"type":110,"value":2624},"1",{"type":104,"tag":267,"props":2626,"children":2627},{},[2628],{"type":104,"tag":131,"props":2629,"children":2630},{},[2631],{"type":110,"value":2632},"Bulk Redirects",{"type":104,"tag":267,"props":2634,"children":2635},{},[2636],{"type":110,"value":2637},"Up to 1M static path→path redirects",{"type":104,"tag":267,"props":2639,"children":2640},{},[2641],{"type":110,"value":2642},"No (runtime via Dashboard\u002FAPI\u002FCLI)",{"type":104,"tag":267,"props":2644,"children":2645},{},[2646],{"type":110,"value":2647},"Dashboard, CSV upload, REST API",{"type":104,"tag":231,"props":2649,"children":2650},{},[2651,2656,2664,2669,2674],{"type":104,"tag":267,"props":2652,"children":2653},{},[2654],{"type":110,"value":2655},"2",{"type":104,"tag":267,"props":2657,"children":2658},{},[2659],{"type":104,"tag":131,"props":2660,"children":2661},{},[2662],{"type":110,"value":2663},"Project-Level Routes",{"type":104,"tag":267,"props":2665,"children":2666},{},[2667],{"type":110,"value":2668},"Headers, rewrites, redirects",{"type":104,"tag":267,"props":2670,"children":2671},{},[2672],{"type":110,"value":2673},"No (instant publish)",{"type":104,"tag":267,"props":2675,"children":2676},{},[2677],{"type":110,"value":2678},"Dashboard, API, CLI, Vercel SDK",{"type":104,"tag":231,"props":2680,"children":2681},{},[2682,2687,2695,2700,2705],{"type":104,"tag":267,"props":2683,"children":2684},{},[2685],{"type":110,"value":2686},"3",{"type":104,"tag":267,"props":2688,"children":2689},{},[2690],{"type":104,"tag":131,"props":2691,"children":2692},{},[2693],{"type":110,"value":2694},"Deployment Config Routes",{"type":104,"tag":267,"props":2696,"children":2697},{},[2698],{"type":110,"value":2699},"Full routing rules",{"type":104,"tag":267,"props":2701,"children":2702},{},[2703],{"type":110,"value":2704},"Yes (deploy)",{"type":104,"tag":267,"props":2706,"children":2707},{},[2708,2713,2714,2719,2720],{"type":104,"tag":161,"props":2709,"children":2711},{"className":2710},[],[2712],{"type":110,"value":59},{"type":110,"value":1216},{"type":104,"tag":161,"props":2715,"children":2717},{"className":2716},[],[2718],{"type":110,"value":61},{"type":110,"value":1216},{"type":104,"tag":161,"props":2721,"children":2723},{"className":2722},[],[2724],{"type":110,"value":2725},"next.config.ts",{"type":104,"tag":113,"props":2727,"children":2728},{},[2729,2734],{"type":104,"tag":131,"props":2730,"children":2731},{},[2732],{"type":110,"value":2733},"Project-level routes",{"type":110,"value":2735}," (added March 2026) let you update routing rules — response headers, rewrites to external APIs — without triggering a new deployment. They run after bulk redirects and before deployment config routes. Available on all plans.",{"type":104,"tag":1623,"props":2737,"children":2739},{"id":2738},"project-level-routes-configuration-methods",[2740],{"type":110,"value":2741},"Project-Level Routes — Configuration Methods",{"type":104,"tag":113,"props":2743,"children":2744},{},[2745],{"type":110,"value":2746},"Project-level routes take effect instantly (no deploy required). Four ways to manage them:",{"type":104,"tag":223,"props":2748,"children":2749},{},[2750,2766],{"type":104,"tag":227,"props":2751,"children":2752},{},[2753],{"type":104,"tag":231,"props":2754,"children":2755},{},[2756,2761],{"type":104,"tag":235,"props":2757,"children":2758},{},[2759],{"type":110,"value":2760},"Method",{"type":104,"tag":235,"props":2762,"children":2763},{},[2764],{"type":110,"value":2765},"How",{"type":104,"tag":260,"props":2767,"children":2768},{},[2769,2785,2807,2859],{"type":104,"tag":231,"props":2770,"children":2771},{},[2772,2780],{"type":104,"tag":267,"props":2773,"children":2774},{},[2775],{"type":104,"tag":131,"props":2776,"children":2777},{},[2778],{"type":110,"value":2779},"Dashboard",{"type":104,"tag":267,"props":2781,"children":2782},{},[2783],{"type":110,"value":2784},"Project → CDN → Routing tab. Live map of global traffic, cache management, and route editor in one view.",{"type":104,"tag":231,"props":2786,"children":2787},{},[2788,2796],{"type":104,"tag":267,"props":2789,"children":2790},{},[2791],{"type":104,"tag":131,"props":2792,"children":2793},{},[2794],{"type":110,"value":2795},"REST API",{"type":104,"tag":267,"props":2797,"children":2798},{},[2799,2805],{"type":104,"tag":161,"props":2800,"children":2802},{"className":2801},[],[2803],{"type":110,"value":2804},"GET\u002FPOST\u002FPATCH\u002FDELETE \u002Fv1\u002Fprojects\u002F{projectId}\u002Froutes",{"type":110,"value":2806}," — 8 dedicated endpoints for CRUD on project routes.",{"type":104,"tag":231,"props":2808,"children":2809},{},[2810,2818],{"type":104,"tag":267,"props":2811,"children":2812},{},[2813],{"type":104,"tag":131,"props":2814,"children":2815},{},[2816],{"type":110,"value":2817},"Vercel CLI",{"type":104,"tag":267,"props":2819,"children":2820},{},[2821,2823,2828,2830,2836,2838,2844,2845,2851,2852,2858],{"type":110,"value":2822},"Managed via ",{"type":104,"tag":161,"props":2824,"children":2826},{"className":2825},[],[2827],{"type":110,"value":61},{"type":110,"value":2829}," \u002F ",{"type":104,"tag":161,"props":2831,"children":2833},{"className":2832},[],[2834],{"type":110,"value":2835},"@vercel\u002Fconfig",{"type":110,"value":2837}," commands (",{"type":104,"tag":161,"props":2839,"children":2841},{"className":2840},[],[2842],{"type":110,"value":2843},"compile",{"type":110,"value":1216},{"type":104,"tag":161,"props":2846,"children":2848},{"className":2847},[],[2849],{"type":110,"value":2850},"validate",{"type":110,"value":1216},{"type":104,"tag":161,"props":2853,"children":2855},{"className":2854},[],[2856],{"type":110,"value":2857},"generate",{"type":110,"value":1333},{"type":104,"tag":231,"props":2860,"children":2861},{},[2862,2870],{"type":104,"tag":267,"props":2863,"children":2864},{},[2865],{"type":104,"tag":131,"props":2866,"children":2867},{},[2868],{"type":110,"value":2869},"Vercel SDK",{"type":104,"tag":267,"props":2871,"children":2872},{},[2873,2878,2880,2886,2887,2893,2894,2900,2902,2908,2910,2916],{"type":104,"tag":161,"props":2874,"children":2876},{"className":2875},[],[2877],{"type":110,"value":2835},{"type":110,"value":2879}," helpers: ",{"type":104,"tag":161,"props":2881,"children":2883},{"className":2882},[],[2884],{"type":110,"value":2885},"routes.redirect()",{"type":110,"value":1216},{"type":104,"tag":161,"props":2888,"children":2890},{"className":2889},[],[2891],{"type":110,"value":2892},"routes.rewrite()",{"type":110,"value":1216},{"type":104,"tag":161,"props":2895,"children":2897},{"className":2896},[],[2898],{"type":110,"value":2899},"routes.header()",{"type":110,"value":2901},", plus ",{"type":104,"tag":161,"props":2903,"children":2905},{"className":2904},[],[2906],{"type":110,"value":2907},"has",{"type":110,"value":2909},"\u002F",{"type":104,"tag":161,"props":2911,"children":2913},{"className":2912},[],[2914],{"type":110,"value":2915},"missing",{"type":110,"value":2917}," conditions and transforms.",{"type":104,"tag":113,"props":2919,"children":2920},{},[2921],{"type":110,"value":2922},"Use project-level routes for operational changes (CORS headers, API proxy rewrites, A\u002FB redirects) that shouldn't require a full redeploy.",{"type":104,"tag":119,"props":2924,"children":2926},{"id":2925},"programmatic-configuration-with-vercelts",[2927,2929],{"type":110,"value":2928},"Programmatic Configuration with ",{"type":104,"tag":161,"props":2930,"children":2932},{"className":2931},[],[2933],{"type":110,"value":61},{"type":104,"tag":113,"props":2935,"children":2936},{},[2937,2939,2944,2946,2951,2953,2959,2960,2966,2967,2973,2974,2980,2982,2987],{"type":110,"value":2938},"Instead of static ",{"type":104,"tag":161,"props":2940,"children":2942},{"className":2941},[],[2943],{"type":110,"value":59},{"type":110,"value":2945},", you can use ",{"type":104,"tag":161,"props":2947,"children":2949},{"className":2948},[],[2950],{"type":110,"value":61},{"type":110,"value":2952}," (or ",{"type":104,"tag":161,"props":2954,"children":2956},{"className":2955},[],[2957],{"type":110,"value":2958},".js",{"type":110,"value":1216},{"type":104,"tag":161,"props":2961,"children":2963},{"className":2962},[],[2964],{"type":110,"value":2965},".mjs",{"type":110,"value":1216},{"type":104,"tag":161,"props":2968,"children":2970},{"className":2969},[],[2971],{"type":110,"value":2972},".cjs",{"type":110,"value":1216},{"type":104,"tag":161,"props":2975,"children":2977},{"className":2976},[],[2978],{"type":110,"value":2979},".mts",{"type":110,"value":2981},") with the ",{"type":104,"tag":161,"props":2983,"children":2985},{"className":2984},[],[2986],{"type":110,"value":2835},{"type":110,"value":2988}," package for type-safe, dynamic routing configuration:",{"type":104,"tag":475,"props":2990,"children":2992},{"className":560,"code":2991,"language":562,"meta":480,"style":480},"\u002F\u002F vercel.ts\nimport { defineConfig } from '@vercel\u002Fconfig';\n\nexport default defineConfig({\n  rewrites: [\n    { source: '\u002Fapi\u002F:path*', destination: 'https:\u002F\u002Fbackend.example.com\u002F:path*' },\n  ],\n  headers: [\n    { source: '\u002F(.*)', headers: [{ key: 'X-Frame-Options', value: 'DENY' }] },\n  ],\n});\n",[2993],{"type":104,"tag":161,"props":2994,"children":2995},{"__ignoreMap":480},[2996,3004,3044,3051,3074,3091,3151,3163,3179,3288,3299],{"type":104,"tag":486,"props":2997,"children":2998},{"class":488,"line":489},[2999],{"type":104,"tag":486,"props":3000,"children":3001},{"style":631},[3002],{"type":110,"value":3003},"\u002F\u002F vercel.ts\n",{"type":104,"tag":486,"props":3005,"children":3006},{"class":488,"line":499},[3007,3011,3015,3020,3024,3028,3032,3036,3040],{"type":104,"tag":486,"props":3008,"children":3009},{"style":572},[3010],{"type":110,"value":676},{"type":104,"tag":486,"props":3012,"children":3013},{"style":493},[3014],{"type":110,"value":681},{"type":104,"tag":486,"props":3016,"children":3017},{"style":583},[3018],{"type":110,"value":3019}," defineConfig",{"type":104,"tag":486,"props":3021,"children":3022},{"style":493},[3023],{"type":110,"value":700},{"type":104,"tag":486,"props":3025,"children":3026},{"style":572},[3027],{"type":110,"value":705},{"type":104,"tag":486,"props":3029,"children":3030},{"style":493},[3031],{"type":110,"value":614},{"type":104,"tag":486,"props":3033,"children":3034},{"style":527},[3035],{"type":110,"value":2835},{"type":104,"tag":486,"props":3037,"children":3038},{"style":493},[3039],{"type":110,"value":623},{"type":104,"tag":486,"props":3041,"children":3042},{"style":493},[3043],{"type":110,"value":723},{"type":104,"tag":486,"props":3045,"children":3046},{"class":488,"line":538},[3047],{"type":104,"tag":486,"props":3048,"children":3049},{"emptyLinePlaceholder":729},[3050],{"type":110,"value":732},{"type":104,"tag":486,"props":3052,"children":3053},{"class":488,"line":735},[3054,3058,3062,3066,3070],{"type":104,"tag":486,"props":3055,"children":3056},{"style":572},[3057],{"type":110,"value":575},{"type":104,"tag":486,"props":3059,"children":3060},{"style":572},[3061],{"type":110,"value":745},{"type":104,"tag":486,"props":3063,"children":3064},{"style":753},[3065],{"type":110,"value":3019},{"type":104,"tag":486,"props":3067,"children":3068},{"style":583},[3069],{"type":110,"value":761},{"type":104,"tag":486,"props":3071,"children":3072},{"style":493},[3073],{"type":110,"value":496},{"type":104,"tag":486,"props":3075,"children":3076},{"class":488,"line":788},[3077,3082,3086],{"type":104,"tag":486,"props":3078,"children":3079},{"style":602},[3080],{"type":110,"value":3081},"  rewrites",{"type":104,"tag":486,"props":3083,"children":3084},{"style":493},[3085],{"type":110,"value":473},{"type":104,"tag":486,"props":3087,"children":3088},{"style":583},[3089],{"type":110,"value":3090}," [\n",{"type":104,"tag":486,"props":3092,"children":3093},{"class":488,"line":37},[3094,3099,3104,3108,3112,3116,3120,3124,3129,3133,3137,3142,3146],{"type":104,"tag":486,"props":3095,"children":3096},{"style":493},[3097],{"type":110,"value":3098},"    {",{"type":104,"tag":486,"props":3100,"children":3101},{"style":602},[3102],{"type":110,"value":3103}," source",{"type":104,"tag":486,"props":3105,"children":3106},{"style":493},[3107],{"type":110,"value":473},{"type":104,"tag":486,"props":3109,"children":3110},{"style":493},[3111],{"type":110,"value":614},{"type":104,"tag":486,"props":3113,"children":3114},{"style":527},[3115],{"type":110,"value":1500},{"type":104,"tag":486,"props":3117,"children":3118},{"style":493},[3119],{"type":110,"value":623},{"type":104,"tag":486,"props":3121,"children":3122},{"style":493},[3123],{"type":110,"value":628},{"type":104,"tag":486,"props":3125,"children":3126},{"style":602},[3127],{"type":110,"value":3128}," destination",{"type":104,"tag":486,"props":3130,"children":3131},{"style":493},[3132],{"type":110,"value":473},{"type":104,"tag":486,"props":3134,"children":3135},{"style":493},[3136],{"type":110,"value":614},{"type":104,"tag":486,"props":3138,"children":3139},{"style":527},[3140],{"type":110,"value":3141},"https:\u002F\u002Fbackend.example.com\u002F:path*",{"type":104,"tag":486,"props":3143,"children":3144},{"style":493},[3145],{"type":110,"value":623},{"type":104,"tag":486,"props":3147,"children":3148},{"style":493},[3149],{"type":110,"value":3150}," },\n",{"type":104,"tag":486,"props":3152,"children":3153},{"class":488,"line":887},[3154,3159],{"type":104,"tag":486,"props":3155,"children":3156},{"style":583},[3157],{"type":110,"value":3158},"  ]",{"type":104,"tag":486,"props":3160,"children":3161},{"style":493},[3162],{"type":110,"value":1590},{"type":104,"tag":486,"props":3164,"children":3165},{"class":488,"line":1004},[3166,3171,3175],{"type":104,"tag":486,"props":3167,"children":3168},{"style":602},[3169],{"type":110,"value":3170},"  headers",{"type":104,"tag":486,"props":3172,"children":3173},{"style":493},[3174],{"type":110,"value":473},{"type":104,"tag":486,"props":3176,"children":3177},{"style":583},[3178],{"type":110,"value":3090},{"type":104,"tag":486,"props":3180,"children":3181},{"class":488,"line":1033},[3182,3186,3190,3194,3198,3203,3207,3211,3215,3219,3223,3227,3232,3236,3240,3245,3249,3253,3258,3262,3266,3271,3275,3279,3283],{"type":104,"tag":486,"props":3183,"children":3184},{"style":493},[3185],{"type":110,"value":3098},{"type":104,"tag":486,"props":3187,"children":3188},{"style":602},[3189],{"type":110,"value":3103},{"type":104,"tag":486,"props":3191,"children":3192},{"style":493},[3193],{"type":110,"value":473},{"type":104,"tag":486,"props":3195,"children":3196},{"style":493},[3197],{"type":110,"value":614},{"type":104,"tag":486,"props":3199,"children":3200},{"style":527},[3201],{"type":110,"value":3202},"\u002F(.*)",{"type":104,"tag":486,"props":3204,"children":3205},{"style":493},[3206],{"type":110,"value":623},{"type":104,"tag":486,"props":3208,"children":3209},{"style":493},[3210],{"type":110,"value":628},{"type":104,"tag":486,"props":3212,"children":3213},{"style":602},[3214],{"type":110,"value":1759},{"type":104,"tag":486,"props":3216,"children":3217},{"style":493},[3218],{"type":110,"value":473},{"type":104,"tag":486,"props":3220,"children":3221},{"style":583},[3222],{"type":110,"value":1475},{"type":104,"tag":486,"props":3224,"children":3225},{"style":493},[3226],{"type":110,"value":1754},{"type":104,"tag":486,"props":3228,"children":3229},{"style":602},[3230],{"type":110,"value":3231}," key",{"type":104,"tag":486,"props":3233,"children":3234},{"style":493},[3235],{"type":110,"value":473},{"type":104,"tag":486,"props":3237,"children":3238},{"style":493},[3239],{"type":110,"value":614},{"type":104,"tag":486,"props":3241,"children":3242},{"style":527},[3243],{"type":110,"value":3244},"X-Frame-Options",{"type":104,"tag":486,"props":3246,"children":3247},{"style":493},[3248],{"type":110,"value":623},{"type":104,"tag":486,"props":3250,"children":3251},{"style":493},[3252],{"type":110,"value":628},{"type":104,"tag":486,"props":3254,"children":3255},{"style":602},[3256],{"type":110,"value":3257}," value",{"type":104,"tag":486,"props":3259,"children":3260},{"style":493},[3261],{"type":110,"value":473},{"type":104,"tag":486,"props":3263,"children":3264},{"style":493},[3265],{"type":110,"value":614},{"type":104,"tag":486,"props":3267,"children":3268},{"style":527},[3269],{"type":110,"value":3270},"DENY",{"type":104,"tag":486,"props":3272,"children":3273},{"style":493},[3274],{"type":110,"value":623},{"type":104,"tag":486,"props":3276,"children":3277},{"style":493},[3278],{"type":110,"value":700},{"type":104,"tag":486,"props":3280,"children":3281},{"style":583},[3282],{"type":110,"value":1509},{"type":104,"tag":486,"props":3284,"children":3285},{"style":493},[3286],{"type":110,"value":3287},"},\n",{"type":104,"tag":486,"props":3289,"children":3290},{"class":488,"line":1041},[3291,3295],{"type":104,"tag":486,"props":3292,"children":3293},{"style":583},[3294],{"type":110,"value":3158},{"type":104,"tag":486,"props":3296,"children":3297},{"style":493},[3298],{"type":110,"value":1590},{"type":104,"tag":486,"props":3300,"children":3301},{"class":488,"line":1049},[3302,3307,3311],{"type":104,"tag":486,"props":3303,"children":3304},{"style":493},[3305],{"type":110,"value":3306},"}",{"type":104,"tag":486,"props":3308,"children":3309},{"style":583},[3310],{"type":110,"value":334},{"type":104,"tag":486,"props":3312,"children":3313},{"style":493},[3314],{"type":110,"value":723},{"type":104,"tag":113,"props":3316,"children":3317},{},[3318],{"type":110,"value":3319},"CLI commands:",{"type":104,"tag":146,"props":3321,"children":3322},{},[3323,3334,3345],{"type":104,"tag":150,"props":3324,"children":3325},{},[3326,3332],{"type":104,"tag":161,"props":3327,"children":3329},{"className":3328},[],[3330],{"type":110,"value":3331},"npx @vercel\u002Fconfig compile",{"type":110,"value":3333}," — compile to JSON (stdout)",{"type":104,"tag":150,"props":3335,"children":3336},{},[3337,3343],{"type":104,"tag":161,"props":3338,"children":3340},{"className":3339},[],[3341],{"type":110,"value":3342},"npx @vercel\u002Fconfig validate",{"type":110,"value":3344}," — validate and show summary",{"type":104,"tag":150,"props":3346,"children":3347},{},[3348,3354,3356,3361],{"type":104,"tag":161,"props":3349,"children":3351},{"className":3350},[],[3352],{"type":110,"value":3353},"npx @vercel\u002Fconfig generate",{"type":110,"value":3355}," — generate ",{"type":104,"tag":161,"props":3357,"children":3359},{"className":3358},[],[3360],{"type":110,"value":59},{"type":110,"value":3362}," locally for development",{"type":104,"tag":113,"props":3364,"children":3365},{},[3366,3371,3373,3378,3379,3384],{"type":104,"tag":131,"props":3367,"children":3368},{},[3369],{"type":110,"value":3370},"Constraint",{"type":110,"value":3372},": Only one config file per project — ",{"type":104,"tag":161,"props":3374,"children":3376},{"className":3375},[],[3377],{"type":110,"value":59},{"type":110,"value":167},{"type":104,"tag":161,"props":3380,"children":3382},{"className":3381},[],[3383],{"type":110,"value":61},{"type":110,"value":3385},", not both.",{"type":104,"tag":119,"props":3387,"children":3389},{"id":3388},"when-to-use",[3390],{"type":110,"value":258},{"type":104,"tag":146,"props":3392,"children":3393},{},[3394,3399,3404,3409,3414,3419],{"type":104,"tag":150,"props":3395,"children":3396},{},[3397],{"type":110,"value":3398},"Geo-personalization of static pages (runs before cache)",{"type":104,"tag":150,"props":3400,"children":3401},{},[3402],{"type":110,"value":3403},"A\u002FB testing rewrites with Edge Config",{"type":104,"tag":150,"props":3405,"children":3406},{},[3407],{"type":110,"value":3408},"Custom redirects based on request properties",{"type":104,"tag":150,"props":3410,"children":3411},{},[3412],{"type":110,"value":3413},"Header injection (CSP, CORS, custom headers)",{"type":104,"tag":150,"props":3415,"children":3416},{},[3417],{"type":110,"value":3418},"Lightweight auth checks (defense-in-depth only — not sole auth layer)",{"type":104,"tag":150,"props":3420,"children":3421},{},[3422],{"type":110,"value":3423},"Project-level routes for headers\u002Frewrites without redeploying",{"type":104,"tag":119,"props":3425,"children":3427},{"id":3426},"when-not-to-use",[3428],{"type":110,"value":3429},"When NOT to Use",{"type":104,"tag":146,"props":3431,"children":3432},{},[3433,3443,3448,3453,3458],{"type":104,"tag":150,"props":3434,"children":3435},{},[3436,3438],{"type":110,"value":3437},"Need full Node.js APIs in Next.js → use ",{"type":104,"tag":161,"props":3439,"children":3441},{"className":3440},[],[3442],{"type":110,"value":47},{"type":104,"tag":150,"props":3444,"children":3445},{},[3446],{"type":110,"value":3447},"General compute at the edge → use Edge Functions",{"type":104,"tag":150,"props":3449,"children":3450},{},[3451],{"type":110,"value":3452},"Heavy business logic or database queries → use server-side framework features",{"type":104,"tag":150,"props":3454,"children":3455},{},[3456],{"type":110,"value":3457},"Auth as sole protection → use Layouts, Server Components, or Route Handlers",{"type":104,"tag":150,"props":3459,"children":3460},{},[3461],{"type":110,"value":3462},"Thousands of static redirects → use Bulk Redirects (up to 1M per project)",{"type":104,"tag":119,"props":3464,"children":3466},{"id":3465},"references",[3467],{"type":110,"value":3468},"References",{"type":104,"tag":146,"props":3470,"children":3471},{},[3472,3484,3495],{"type":104,"tag":150,"props":3473,"children":3474},{},[3475,3477],{"type":110,"value":3476},"📖 docs: ",{"type":104,"tag":3478,"props":3479,"children":3482},"a",{"href":40,"rel":3480},[3481],"nofollow",[3483],{"type":110,"value":40},{"type":104,"tag":150,"props":3485,"children":3486},{},[3487,3489],{"type":110,"value":3488},"📖 API reference: ",{"type":104,"tag":3478,"props":3490,"children":3493},{"href":3491,"rel":3492},"https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\u002Fapi",[3481],[3494],{"type":110,"value":3491},{"type":104,"tag":150,"props":3496,"children":3497},{},[3498,3500],{"type":110,"value":3499},"📖 getting started: ",{"type":104,"tag":3478,"props":3501,"children":3504},{"href":3502,"rel":3503},"https:\u002F\u002Fvercel.com\u002Fdocs\u002Frouting-middleware\u002Fgetting-started",[3481],[3505],{"type":110,"value":3502},{"type":104,"tag":3507,"props":3508,"children":3509},"style",{},[3510],{"type":110,"value":3511},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":3513,"total":3623},[3514,3531,3548,3565,3580,3597,3612],{"slug":3515,"name":3515,"fn":3516,"description":3517,"org":3518,"tags":3519,"stars":23,"repoUrl":24,"updatedAt":3530},"ai-gateway","configure and manage Vercel AI Gateway","Vercel AI Gateway expert guidance. Use when configuring model routing, provider failover, cost tracking, or managing multiple AI providers through a unified API.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3520,3523,3526,3529],{"name":3521,"slug":3522,"type":15},"AI Infrastructure","ai-infrastructure",{"name":3524,"slug":3525,"type":15},"Cost Optimization","cost-optimization",{"name":3527,"slug":3528,"type":15},"LLM","llm",{"name":9,"slug":8,"type":15},"2026-04-06T18:56:06.57787",{"slug":92,"name":92,"fn":3532,"description":3533,"org":3534,"tags":3535,"stars":23,"repoUrl":24,"updatedAt":3547},"integrate authentication in Next.js apps","Authentication integration guidance — Clerk (native Vercel Marketplace), Descope, and Auth0 setup for Next.js applications. Covers middleware auth patterns, sign-in\u002Fsign-up flows, and Marketplace provisioning. Use when implementing user authentication.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3536,3539,3542,3545,3546],{"name":3537,"slug":3538,"type":15},"Auth0","auth0",{"name":3540,"slug":3541,"type":15},"Authentication","authentication",{"name":3543,"slug":3544,"type":15},"Next.js","next-js",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-04-06T18:56:17.050565",{"slug":3549,"name":3549,"fn":3550,"description":3551,"org":3552,"tags":3553,"stars":23,"repoUrl":24,"updatedAt":3564},"bootstrap","bootstrap Vercel-linked repositories","Project bootstrapping orchestrator for repos that depend on Vercel-linked resources (databases, auth, and managed integrations). Use when setting up or repairing a repository so linking, environment provisioning, env pulls, and first-run db\u002Fdev commands happen in the correct safe order.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3554,3557,3560,3563],{"name":3555,"slug":3556,"type":15},"Configuration","configuration",{"name":3558,"slug":3559,"type":15},"Deployment","deployment",{"name":3561,"slug":3562,"type":15},"Local Development","local-development",{"name":9,"slug":8,"type":15},"2026-04-06T18:56:18.297868",{"slug":3566,"name":3566,"fn":3567,"description":3568,"org":3569,"tags":3570,"stars":23,"repoUrl":24,"updatedAt":3579},"cdn-caching","debug Vercel CDN caching behavior","Debug Vercel CDN caching — cache hit rate, stale content, revalidation behavior, ISR + PPR, per-request cache reasons (cacheReason) and PPR state (ppr_state), and costs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3571,3574,3577,3578],{"name":3572,"slug":3573,"type":15},"Caching","caching",{"name":3575,"slug":3576,"type":15},"Observability","observability",{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:31:34.628944",{"slug":3581,"name":3581,"fn":3582,"description":3583,"org":3584,"tags":3585,"stars":23,"repoUrl":24,"updatedAt":3596},"chat-sdk","build multi-platform chatbots with Vercel","Vercel Chat SDK expert guidance. Use when building multi-platform chat bots — Slack, Telegram, Microsoft Teams, Discord, Google Chat, GitHub, Linear — with a single codebase. Covers the Chat class, adapters, threads, messages, cards, modals, streaming, state management, and webhook setup.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3586,3589,3592,3595],{"name":3587,"slug":3588,"type":15},"Agents","agents",{"name":3590,"slug":3591,"type":15},"Messaging","messaging",{"name":3593,"slug":3594,"type":15},"SDK","sdk",{"name":9,"slug":8,"type":15},"2026-04-06T18:56:26.921901",{"slug":3598,"name":3598,"fn":3599,"description":3600,"org":3601,"tags":3602,"stars":23,"repoUrl":24,"updatedAt":3611},"deployments-cicd","manage Vercel deployments and CI\u002FCD","Vercel deployment and CI\u002FCD expert guidance. Use when deploying, promoting, rolling back, inspecting deployments, building with --prebuilt, or configuring CI workflow files for Vercel.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3603,3606,3607,3610],{"name":3604,"slug":3605,"type":15},"CI\u002FCD","ci-cd",{"name":3558,"slug":3559,"type":15},{"name":3608,"slug":3609,"type":15},"Operations","operations",{"name":9,"slug":8,"type":15},"2026-04-06T18:56:22.054263",{"slug":3613,"name":3613,"fn":3614,"description":3615,"org":3616,"tags":3617,"stars":23,"repoUrl":24,"updatedAt":3622},"env-vars","manage Vercel environment variables","Vercel environment variable expert guidance. Use when working with .env files, vercel env commands, OIDC tokens, or managing environment-specific configuration.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3618,3619,3620,3621],{"name":3555,"slug":3556,"type":15},{"name":3608,"slug":3609,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-04-06T18:56:28.150777",29,{"items":3625,"total":3788},[3626,3644,3656,3673,3684,3697,3713,3727,3739,3758,3768,3778],{"slug":3627,"name":3627,"fn":3628,"description":3629,"org":3630,"tags":3631,"stars":3641,"repoUrl":3642,"updatedAt":3643},"next-cache-components-adoption","enable and migrate to Next.js Cache Components","Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the `cacheComponents` flag, work through a flood of blocking-prerender \u002F instant validation errors, run the `cache-components-instant-false` codemod, or decide between opting routes out with `export const instant = false` and fixing them in place.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3632,3633,3636,3639,3640],{"name":3572,"slug":3573,"type":15},{"name":3634,"slug":3635,"type":15},"Frontend","frontend",{"name":3637,"slug":3638,"type":15},"Migration","migration",{"name":3543,"slug":3544,"type":15},{"name":9,"slug":8,"type":15},141208,"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fnext.js","2026-07-24T05:38:30.118542",{"slug":3645,"name":3645,"fn":3646,"description":3647,"org":3648,"tags":3649,"stars":3641,"repoUrl":3642,"updatedAt":3655},"next-cache-components-optimizer","optimize Next.js cache components","Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components \u002F PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next\u002Fplaywright instant() e2e and work it to green, one verified route at a time; the shipped test then guards against regression. Use when asked to make a route's navigation instant (its static shell commits immediately), fix a route whose static shell isn't prerendered\u002Fserved\u002Fprefetched, grow a route's static shell or fix its slow first paint, diagnose which Suspense boundary keeps a route out of its static shell, or write the instant() e2e guard for one. Requires Next.js 16.3+ with cacheComponents; directs an upgrade if older.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3650,3651,3652,3653,3654],{"name":3572,"slug":3573,"type":15},{"name":3634,"slug":3635,"type":15},{"name":3543,"slug":3544,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:31:10.674078",{"slug":3657,"name":3657,"fn":3658,"description":3659,"org":3660,"tags":3661,"stars":3641,"repoUrl":3642,"updatedAt":3672},"next-dev-loop","verify Next.js runtime behavior","Verify Next.js runtime behavior after editing app code. Use this skill to confirm a change actually works in a running app — not just that it compiles or type-checks. Combines \u002F_next\u002Fmcp (Next.js's view) with agent-browser (the browser's view). Requires a running `next dev`.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3662,3665,3666,3667,3668,3669],{"name":3663,"slug":3664,"type":15},"Debugging","debugging",{"name":3634,"slug":3635,"type":15},{"name":3561,"slug":3562,"type":15},{"name":3543,"slug":3544,"type":15},{"name":9,"slug":8,"type":15},{"name":3670,"slug":3671,"type":15},"Web Development","web-development","2026-05-22T06:45:28.627735",{"slug":3674,"name":3674,"fn":3675,"description":3676,"org":3677,"tags":3678,"stars":3641,"repoUrl":3642,"updatedAt":3683},"next-partial-prefetching-adoption","adopt Partial Prefetching in Next.js apps","Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the `partialPrefetching` flag, opt routes in with `export const prefetch = 'partial'`, audit `\u003CLink prefetch={true}>` calls, or resolve the link-prefetch-partial and instant-shell-url-data insights.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3679,3680,3681,3682],{"name":3634,"slug":3635,"type":15},{"name":3543,"slug":3544,"type":15},{"name":17,"slug":18,"type":15},{"name":9,"slug":8,"type":15},"2026-07-30T05:31:11.591864",{"slug":3685,"name":3685,"fn":3686,"description":3687,"org":3688,"tags":3689,"stars":3694,"repoUrl":3695,"updatedAt":3696},"turborepo","manage monorepos with Turborepo","Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines,\ndependsOn, caching, remote cache, the \"turbo\" CLI, --filter, --affected, CI optimization, environment\nvariables, internal packages, monorepo structure\u002Fbest practices, and boundaries.\n\nUse when user: configures tasks\u002Fworkflows\u002Fpipelines, creates packages, sets up\nmonorepo, shares code between apps, runs changed\u002Faffected packages, debugs cache,\nor has apps\u002Fpackages directories.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3690,3691,3692],{"name":3604,"slug":3605,"type":15},{"name":17,"slug":18,"type":15},{"name":3693,"slug":3685,"type":15},"Turborepo",30809,"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fturborepo","2026-07-30T05:32:14.920116",{"slug":3698,"name":3698,"fn":3699,"description":3700,"org":3701,"tags":3702,"stars":3710,"repoUrl":3711,"updatedAt":3712},"add-function-examples","add AI function examples for testing","Guide for adding new AI function examples, for testing specific features against the actual provider APIs.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3703,3706,3709],{"name":3704,"slug":3705,"type":15},"AI SDK","ai-sdk",{"name":3707,"slug":3708,"type":15},"Testing","testing",{"name":9,"slug":8,"type":15},25670,"https:\u002F\u002Fgithub.com\u002Fvercel\u002Fai","2026-04-06T18:55:51.318866",{"slug":3714,"name":3714,"fn":3715,"description":3716,"org":3717,"tags":3718,"stars":3710,"repoUrl":3711,"updatedAt":3726},"add-harness-package","add AI SDK harness packages","Guide for adding new AI SDK harness packages. Use when creating a new @ai-sdk\u002Fharness-\u003Cname> package that adapts a coding-agent runtime to HarnessV1.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3719,3720,3721,3724,3725],{"name":3587,"slug":3588,"type":15},{"name":3704,"slug":3705,"type":15},{"name":3722,"slug":3723,"type":15},"Harness","harness",{"name":3593,"slug":3594,"type":15},{"name":9,"slug":8,"type":15},"2026-06-18T08:29:19.858737",{"slug":3728,"name":3728,"fn":3729,"description":3730,"org":3731,"tags":3732,"stars":3710,"repoUrl":3711,"updatedAt":3738},"add-provider-package","add new provider packages to AI SDK","Guide for adding new AI provider packages to the AI SDK. Use when creating a new @ai-sdk\u002F\u003Cprovider> package to integrate an AI service into the SDK.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3733,3734,3737],{"name":3704,"slug":3705,"type":15},{"name":3735,"slug":3736,"type":15},"API Development","api-development",{"name":9,"slug":8,"type":15},"2026-04-06T18:55:47.45549",{"slug":3740,"name":3740,"fn":3741,"description":3742,"org":3743,"tags":3744,"stars":3710,"repoUrl":3711,"updatedAt":3757},"adr-skill","create and maintain architecture decision records","Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept\u002Freject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses Socratic questioning to capture intent before drafting, and validates output against an agent-readiness checklist.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3745,3748,3751,3754],{"name":3746,"slug":3747,"type":15},"ADR","adr",{"name":3749,"slug":3750,"type":15},"Architecture","architecture",{"name":3752,"slug":3753,"type":15},"Documentation","documentation",{"name":3755,"slug":3756,"type":15},"Engineering","engineering","2026-04-06T18:55:50.043694",{"slug":3705,"name":3705,"fn":3759,"description":3760,"org":3761,"tags":3762,"stars":3710,"repoUrl":3711,"updatedAt":3767},"build AI features with Vercel AI SDK","Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: \"AI SDK\", \"Vercel AI SDK\", \"generateText\", \"streamText\", \"add AI to my app\", \"build an agent\", \"tool calling\", \"structured output\", \"useChat\".",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3763,3764,3765,3766],{"name":3587,"slug":3588,"type":15},{"name":3704,"slug":3705,"type":15},{"name":3527,"slug":3528,"type":15},{"name":9,"slug":8,"type":15},"2026-04-06T18:55:48.739463",{"slug":3769,"name":3769,"fn":3770,"description":3771,"org":3772,"tags":3773,"stars":3710,"repoUrl":3711,"updatedAt":3777},"capture-api-response-test-fixture","capture API response test fixtures","Capture API response test fixture.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3774,3775,3776],{"name":3735,"slug":3736,"type":15},{"name":3707,"slug":3708,"type":15},{"name":9,"slug":8,"type":15},"2026-04-06T18:55:56.374433",{"slug":3779,"name":3779,"fn":3780,"description":3781,"org":3782,"tags":3783,"stars":3710,"repoUrl":3711,"updatedAt":3787},"develop-ai-functions-example","develop AI SDK function examples","Develop examples for AI SDK functions. Use when creating, running, or modifying examples under examples\u002Fai-functions\u002Fsrc to validate provider support, demonstrate features, or create test fixtures.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[3784,3785,3786],{"name":3704,"slug":3705,"type":15},{"name":3707,"slug":3708,"type":15},{"name":9,"slug":8,"type":15},"2026-04-06T18:55:55.088956",68]