routing-middleware

Intercept and manipulate incoming requests with Vercel Routing Middleware.

246|42|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/vercel/vercel-plugin --skill routing-middleware-vercel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: routing-middleware
Source: https://github.com/vercel/vercel-plugin/tree/main/skills/routing-middleware
Command: npx skills add https://github.com/vercel/vercel-plugin --skill routing-middleware-vercel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Routing-level control to intercept and modify requests before caching, enabling precise routing, rewrites, redirects, geo-based decisions, and personalization across frameworks.

Core Features & Use Cases

  • Intercept requests and apply rewrites/redirects at the edge
  • Enable geo-based routing, personalization, and A/B style variations
  • Runtime-agnostic: supports Edge, Node.js, and Bun with framework-agnostic configuration

Quick Start

Create a root middleware.ts (or proxy.ts for Next.js 16) and configure the runtime and matcher to start intercepting requests.

Frequently Asked Questions about routing-middleware

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I intercept and rewrite incoming requests at the edge before caching?

Edge request interception is achieved by creating a root middleware.ts or proxy.ts file, configuring the runtime, and defining a matcher-based scope to apply rewrites and redirects before caching occurs.

Can I use Vercel routing middleware with Node.js and Bun runtimes, or is it limited to the Edge?

Vercel routing middleware is runtime-agnostic and fully supports Edge, Node.js, and Bun runtimes, allowing framework-agnostic configuration for intercepting and manipulating incoming requests across any application.

What is the best way to set up geo-based routing and personalization for my web app?

Geo-based routing and personalization are implemented through platform-level request interception using Vercel middleware, applying location-based decisions and A/B style variations before the request reaches your application logic.

Do I need a specific file structure to configure redirects and rewrites on Vercel?

Configuring redirects and rewrites requires a root middleware.ts or proxy.ts file for Next.js 16, where you must define the active runtime and establish a matcher-based scope to control request interception.

Does Vercel middleware work with any framework or only Next.js applications?

Vercel middleware applies to any framework, providing platform-level request interception that enables precise routing, rewrites, redirects, and personalization across diverse frameworks and runtimes without framework-specific limitations.

Why use platform-level middleware instead of handling redirects within my application code?

Platform-level middleware intercepts and modifies requests before caching and application execution, enabling precise routing and geo-based decisions at the edge with lower latency than processing redirects within application code.