When to use GATSBY_

Use GATSBY_ for environmental variables (env vars) you use in your client-side code. In practice, that would be almost all of your code. The exceptions are code inside gatsby-node.js, gatsby-config.js, and a page's getServerData or config.

Exposing all env vars on the client would be a major security hazard. We use env vars for things such as API secrets, etc.



All the best,
Queen Raae

Interested in more daily treasures like this one?
Sent directly to your inbox?