Configure env vars, secret injection, provider keys, and runtime access from the function test panel—values persist on the function record and populate process.env / os.environ / os.Getenv when the container starts.
Environment Variables
Set per-function variables in the test panel: open the Config tab, expand Environment, add keys and values, and then save the function. The values are stored on the function record and passed into the container as environment variables when the function runs.
Treat these values as sensitive configuration: they are persisted in the application database together with the rest of the function. When the server is configured with an <code>ENCRYPTION_KEY</code>, env-var values are encrypted at rest with AES-256-GCM (an <code>enc:v1:</code> envelope); without a key they are stored as plain text. Either way, restrict database access, avoid committing real credentials to source control, and rotate any credential that leaks.
Secrets and sensitive values
Use password-style fields in the Environment section so values are harder to read over your shoulder while you type. The platform masks common secret-shaped strings in persisted logs and traces where redaction runs—but this is function configuration, not a full standalone secrets manager.
Rotate credentials if they leak. For long-lived production secrets, prefer injecting values from CI/CD or the host environment rather than storing them only on the function record.
// Per-function env vars (Config → Environment in the editor, or API): await api.updateFunction("function-id", { envVars: { OPENAI_API_KEY: "sk-...", }, }); // Values are stored on the function and injected into the container at invoke time
export async function handler(event, context) { // OPENAI_API_KEY comes from function env — avoid logging it const payload = typeof event.body === 'string' ? JSON.parse(event.body || '{}') : (event || {}); const { prompt } = payload; const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY, }); const completion = await openai.chat.completions.create({ model: "gpt-4o-mini", messages: [{ role: "user", content: prompt }], }); return { statusCode: 200, body: JSON.stringify({ result: completion.choices[0].message.content }), }; }