Skip to content
Back

Appwrite-injected variables are not available in rust function env

  • 0
  • 2
  • Self Hosted
  • Functions
21 Aug, 2026, 14:44

I am using rust-1.83 as a runtime and try to access APPWRITE_FUNCTION_API_ENDPOINT or APPWRITE_FUNCTION_API_KEY during runtime. Both are not set during my executions.

TypeScript
let endpoint = std::env::var("APPWRITE_FUNCTION_API_ENDPOINT")
            .or_else(|_| std::env::var("APPWRITE_ENDPOINT"))
            .map_err(|_| AppError::InternalError("Missing APPWRITE_FUNCTION_API_ENDPOINT".into()))?;

is what i am currently using as a workaround (Setting APPWRITE_ENDPOINT manually in function settings.

TL;DR
Appwrite-injected variables, specifically APPWRITE_FUNCTION_API_KEY, are not accessible in Rust functions' environment. The workaround is to generate an API key in the project dashboard and store it as a manual environment variable.
21 Aug, 2026, 15:52

nice catch! Ill look into this early next week <@287294735054274560>

21 Aug, 2026, 16:07

Thanks! <@287294735054274560> Is there any workaround available for APPWRITE_FUNCTION_API_KEY? This is set at deployment time and i dont have access to it. Everything else I have a solution

21 Aug, 2026, 16:11

Until I fix it, sadly no nice work-around. You would need to go to project dashboard, generate API key, and store it as manual env variable

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