You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
We can't use any of the .env vars in the front-end code. We have the following code in gatsby-config.js which should enable us to do so though
You have to expose these via sitemetadata, and I already have hooks and class-based ways to get it via Gatsby's GraphQL. See my changes in https://github.com/Seneca-CDOT/telescope/pull/690/files for an example. Just read in env vars at build time, like I do with telescopeUrl, and then expose them in the sitemetadata. Then you can get them in your components in the frontend.
What happened:
We can't use any of the .env vars in the front-end code. We have the following code in
gatsby-config.js
which should enable us to do so thoughWhat should have happened:
Be able to use .env vars in front-end code
How to reproduce it (as precise as possible):
Anything else we need to know?:
Environment:
The text was updated successfully, but these errors were encountered: