Back

How to add .env for functions locally?

  • 0
  • Functions
  • Cloud
mariojuanaaa
14 Mar, 2025, 16:40

When i run functions locally, how would i add .env variables to test? Im using process.env.VAR_NAME and its running fine on the cloud

TL;DR
To add .env variables for testing functions locally, create a .env file in the function code folder. You can also use the `--with-variables` flag to use remote env vars.
Steven
14 Mar, 2025, 16:52

in the folder where your function code is, add a .env file. if you want to use the remote env vars, run with the --with-variables flag

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