What is Edge Runtime?
A lightweight JavaScript runtime (V8 isolate based) that runs on geographically distributed edge servers, with sub-50ms cold starts globally.
The Edge Runtime is a JavaScript execution environment built on V8 isolates rather than Node.js. It runs your code on Vercel's (or Cloudflare's) global network of edge servers, typically 200+ locations worldwide. Cold starts are under 50ms — usually under 10ms — compared to 200-500ms for traditional Node serverless. The tradeoff: no Node.js stdlib (no `fs`, no `path`, limited `crypto`), smaller bundle limits (typically 1-4 MB), and a subset of npm packages work. Use Edge for: middleware (auth checks, redirects, A/B routing), API endpoints with simple data needs (read from KV, return JSON), and OG image generation (Vercel ImageResponse runs at the edge). Use Node for: anything needing native modules, heavy file I/O, or specific npm packages that depend on Node APIs. In Next.js, opt into Edge Runtime per route by exporting `export const runtime = "edge"`.