Environment variables

NEXT_PUBLIC_BUILD_MESSAGE in the browser: hello from the build.

RUNTIME_MESSAGE on the server: hello at runtime; PORT is 3000.

A NEXT_PUBLIC_ variable is written into the JavaScript during the build: it needs the build phase, and changing it needs a new build. A server-only variable is read when the page renders.

← All checks