Skip to content
Back

Appwrite processing global envs and changing them.

  • 0
  • Functions
  • Cloud
amitrochates
3 May, 2025, 10:53

So I define a global env - GCP_CREDENTIALS in global env of my appwrite projcet and refer to it in my functions as gcp_creds: JSON.PARSE(GCP_CREDENTIALS) to use it. This is what I define it as - { "type": "service_account", "project_id": "abc-csas-xxx123", "private_key_id": "12345", ...} Everything works fine I can access these in my functions until, I open the editor or make any changes in any global env, after updating anything in this env, my GCP_CREDS are automatically processed as { type: service_account,project_id: ace-coda-xxx123, private_key_id: 12345, ...} And now my functions cant read it. How do I fix this. Either by stopping whatever processing appwrite is doing to these or by altering the access method in my functions.

TL;DR
Developers are facing issues with Appwrite processing their global environment variables and changing their format, causing functions to fail in reading them. To fix this, developers can encapsulate the variable value in quotes to ensure it's parsed as a string and maintain its original format.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more