Next.js · Senior · Question 61 of 75

publicRuntimeConfig was removed in Next.js 16. How do you provide config that differs per environment without rebuilding?

Explanation

NEXT_PUBLIC_ values are inlined at build time. Reading process.env in a dynamically rendered server component (e.g. after connection()) picks up the deploy's runtime values.

Further reading

Problem with a question

Next.js · Senior · question 61

Test yourself

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

Take this quiz