Glossary term
What is NEXT_PUBLIC_ (NEXT_PUBLIC_ prefix)?
NEXT_PUBLIC_ stands for NEXT_PUBLIC_ prefix.
In Security for Developers
In Next.js, variables with this prefix are written into the browser bundle at build time, so they are public. Never use it for a real secret.
Learn it properly · Security for DevelopersLesson 5: Secrets, Encryption and Data ProtectionWhere secrets leak (git, logs, front-end bundles), hashing vs encryption vs encoding, TLS in plain words, safe randomness, encrypting data with AES-GCM, and handling personal data.In Next.js App Router
A name prefix that makes Next.js copy an environment variable into the browser JavaScript at build time, where it can no longer change.
Learn it properly · Next.js App RouterLesson 8: Environment, Configuration, Deploying and Production HabitsEnvironment variables and what reaches the browser, next.config, building and running, deploying to Vercel and to a container, logging and monitoring.