Skip to content

Gatsby "client-side" environment variables #3979

Answered by styfle
xmflsct asked this question in General
Discussion options

You must be logged in to vote

Vercel doesn't know the concept of "client-side" because this is determined by your Static Site Generator, in this case Gatsby.

If you need environment variables on the client side, the you'll have to read from the build env vars and probably write a file to the build output, perhaps data.json, or something like that which you can then read from the client side.

https://vercel.com/docs/environment-variables

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@xmflsct
Comment options

Answer selected by styfle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants