NEXT_RUNTIME
An environment variable Next.js sets to nodejs or edge so code can tell which runtime it is running in.
In more detail
Next.js sets it on the server before your code runs. register() checks it to load Node-only instrumentation only in the Node.js runtime.
Related terms
- register() — The function exported from instrumentation.ts that Next.js calls once when a new server instance starts.
- environment variable — A named setting such as PORT=8000 that a program reads from its surroundings when it starts.
- Edge runtime — A lightweight Next.js runtime based on V8 isolates and standard Web APIs, which starts almost instantly but cannot use most Node.js APIs.
Taught in
- Instrumentation: OpenTelemetry & Performance Spans — Next.js 15 & Modern App Router Architecture