Hello Team Netlify,
I have a Gatsby based website which I deployed on Netlify at the address : https://simarmannsingh.netlify.app/.
I recently added an API call to receive contact request from the contactus page here
https://simarmannsingh.netlify.app/contact, and for that I was trying to load the necessary credentials and other information from the environment variables.
I first created the environment variables under the “Site Configuration” → “Environment Variables” section, so that they should be available to the deployment, before triggering any deployment. Then, I proceeded ahead by clearing the cache and triggering the deployment. Unfortunately, for some reason, the deployed site cannot access the environment variables at all.
The logs indicate that the build completes flawlessly. I tried to log the env variables, still no luck.
I read at the docs that gatsby based sites require the client-side env variables to have a prefix “GATSBY_”, I also tried that, it didn’t work.
I am using CloudFlare, so my next thought was maybe it is a cloudflare caching issue. I cleared the cache, put the site in “development mode” (so it disables the caching for some time). That didn’t work either.
Can someone help?