Skip to content
Discussion options

You must be logged in to vote

Next.js only exposes env vars to client-side code if they're prefixed with NEXT_PUBLIC_; anything else is server-only and reads as undefined in the browser by design (so you don't leak secrets). Also, env vars are inlined at build time on Vercel — after adding or changing one you have to trigger a new deploy for it to take effect.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kevinchamplin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant