Back

how to access environment variables in functions using Dart SDK

  • 0
  • Functions
punti_z
4 Oct, 2023, 20:22

Using appwrite version 1.4.4 and running through the documentation and sample function I am not clear how this now works

It used to be "req.variables['VARIABLE_NAME']"

Now I see

process.env. VARIABLE_NAME Platform.environment['VARIABLE_NAME'] ??

TL;DR
The user is asking how to access environment variables in functions using Dart SDK. They mention trying to use "platform" but it wasn't recognized and will try again later. The user is using appwrite version 1.4.4 and is unsure how to access environment variables with the new version. The old way was "req.variables['VARIABLE_NAME']" but now it seems to be "process.env.VARIABLE_NAME" or "Platform.environment['VARIABLE_NAME']".
Drake
4 Oct, 2023, 20:45

yes, it should be Platform.environment

punti_z
4 Oct, 2023, 21:02

Oddly it refuses to recognize "platform" will try again tomorrow and confirm

Drake
4 Oct, 2023, 22:24

It should be Platform. And you night have to import something

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