menu

Netlify

Netlify staff don't answer questions in this chat :) For staff and peer support & talk, head to 👉 community.netlify.com. See you there!

Channels
Team

API keys and environment variables on netlify

October 2, 2019 at 2:14pm

API keys and environment variables on netlify

October 2, 2019 at 2:14pm
I am still a bit confused with all this…a caveat though, I am new to Netlify and to coding… so bear with me.
I have set my .env.development file in my gatsbyJS site so that I can store my API_KEY and APP_ID in order to not expose them when I commit to git. That was perfectly and I am able to ping and use my API endpoint, however I want it to work when my site is live and for same reason, I am not able to do that.
I have also set my environment variables in Netlify UI so that I can have access them at build time (I guess?), on my files I am still using process.env.API_KEY in order to used them, but for same reason I am not able to get to them. How can I inject the variables from NETLIFY UI into my client-side code?
For same reason I am not able to achieve this.
Any guidance would be very much appreciated.
Cheers, Tiago

October 5, 2019 at 5:58am
Anyone with the same issue can refer back to here
  • reply
  • like