Hi, I have self-hosted Appwrite v1.7.4 and the latest Appwrite CLI. I cannot get the "variables" in the appwrite.json to deploy. I am using this format:
"path": "functions/my-node-function",
"variables": {
"API_KEY": "your-secret-api-key",
"DATABASE_URL": "your-database-connection-string",
"NODE_ENV": "production"
}
So, yes, specifying the variables as an object and not an array. Everything else from the appwrite.json deploys fine.
I have seen that this was previously a bug reported by others. Has the bug been reintroduced?
I am using Node.js v22.0 and JavaScript for functions (Node 22 support added in the Appwrite, self-hosted docker .env file)
As a workaround, I have set the variables in the Project Settings - Global variables, which then apply to all functions, but I would like to set these granularly per function on initial deployment (without subsequently applying variables with the CLI and needing another deployment to apply them).
Have I missed anything by chance?
I don't think this is how variables should be deployed? Looking here in the docs it's far different.
https://appwrite.io/docs/tooling/command-line/functions#appwritejson
Thanks, I missed that as I was looking in the docs under functions and older support posts. I'll give that format a try.
As of 8.2.1, vars in the appwrite.json are no longer supported
Recommended threads
- Authentication on custom Websocket Serve...
Hi, I want to use a custom Websocket Server (using Bun) for my application. However I cant really figure out authentication on custom servers. Session cookies ...
- Realtime: Listener not triggered on upda...
I self host appwrite 1.8.1. The genereal functionallity works fine. But my realtime subscription isn't updating. I see "Received heartbeat response from realtim...
- Realtime for files() works almost well, ...
I have been trying to make use of realtime, today (14.03.26) I have pulled all the latest versions of docker images, and sdk available. Whats working: - Conn...