Next.js · Junior · Question 17 of 75

Which environment variables are available in browser code?

Explanation

Next.js substitutes process.env.NEXT_PUBLIC_* into client code at build time, so changing a value requires a rebuild. Other variables are available only on the server - that way secrets (API keys, DB passwords) don't leak to the browser.

Further reading

Problem with a question

Next.js · Junior · question 17

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz