Back

access env variable in a function

  • 0
  • Functions
Aarush Acharya
3 Nov, 2023, 21:27

Unable to access env variables using docs instructions In a appwrite cloud function

TL;DR
Title: Issue accessing environment variable in a function Messages: Some users are experiencing difficulties accessing environment variables in an Appwrite cloud function, even after following the instructions in the documentation. Clearing cache and browsing history did not resolve the issue for some users. One user found success by using `process.env.YOUR_VARIABLE_NAME` syntax in Node. Suggested solution: Try using `process.env.YOUR_VARIABLE_NAME` syntax when accessing environment variables in a Node function.
Meldiron
3 Nov, 2023, 21:28

Hey there 👋 Its a small bug in our docs. in Node, it should be process.env.YOUR_VARIABLE_NAME

Drake
3 Nov, 2023, 21:52

where are you seeing this syntax?

Aarush Acharya
3 Nov, 2023, 22:05

Here

Aarush Acharya
3 Nov, 2023, 22:17
Drake
3 Nov, 2023, 22:26

can you try clearing your cache?

Aarush Acharya
3 Nov, 2023, 22:50

alright will do so

Drake
4 Nov, 2023, 01:17

do you still see {}?

Aarush Acharya
4 Nov, 2023, 08:47

Hey @Steven yes

Aarush Acharya
4 Nov, 2023, 08:47

I still see {}

Aarush Acharya
4 Nov, 2023, 08:47

after clearing all time cached browser data including browsing history and all

Aarush Acharya
4 Nov, 2023, 09:41

Thanks a lot this worked for me

Drake
8 Nov, 2023, 00:39

Hmm perhaps there's still application data in the service worker 🧐

ideclon
8 Nov, 2023, 00:43

I see it sometimes (including in Incognito), but usually a hard reload makes it go away

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