Issue with Workers Environment Variable and External API Key

Subject: Issue with Workers Environment Variable and External API Key

Dear Cloudflare Support Team,

I hope this email finds you well.

I recently created a Workers script using the Cloudflare UI and added an environment variable. However, I encountered an issue where the environment variable does not appear clearly, and I receive the following error message: “TypeError: Cannot read properties of undefined (reading ‘IPQS_KEY’).”

Furthermore, even when I manage to log the variable, the error persists. I’m using this environment variable to access an external API to verify emails submitted through forms on my website. The API and its key work perfectly fine, and the URL is also correct. However, when I use the key directly in the URL or from environment variables set within Cloudflare, the key is considered invalid, while it works fine from anywhere else with the same URL.

I’m wondering if Cloudflare manipulates, encrypts, or alters the data in any way. This issue is causing significant roadblocks for me as I’m unable to onboard new clients with my app if email verifications are hindered.

I’m relatively new to Cloudflare and recently migrated to your platform, so any guidance or assistance in resolving this issue would be greatly appreciated.

Thank you for your attention to this matter.

Sincerely,

Hi @Bluecornflakes,

I just replied in a similar Topic about a Workers Environment Variable related issue, can you please take a look at it and validate if your problem is the same?

If not, int he same way that I suggested in the topic from above, I highly encourage you checking our Discord channel:

Thanks!