Skip to content
v2.7

Variables

Function variables and global project variables, secrets and when a change takes effect.

Variables reach the code in process.env. Use them for keys to other services, URLs and any configuration that changes between environments. Never leave a secret in the uploaded code.

  • Function: the function’s Variables tab. They apply only to it.
  • Global: Project settings → Global variables. They apply to all of the project’s functions. If the function has a variable with the same name, its own wins.

Names: letters, numbers and _, not starting with a number.

Check Secret for sensitive values: once saved, the value no longer appears in the console or the API (it only reaches the code). A secret variable never becomes public again: to change it, edit the value or delete it and create it again.

The console warns you (“Variables changed”) and offers Redeploy, which rebuilds the active code with the new variables. With global variables, redeploy each function that uses them.

Was this page helpful?