Functions

Environment variables and secrets

Per-function configuration in two classes: plain environment variables for non-sensitive values, and encrypted secrets for credentials. Both reach your code as ctx.env at invocation time.

Variables vs secrets

Environment variablesSecrets
Visible in the ConsoleYes, to project membersNames and timestamps only — never values
StorageFunction metadataEncrypted at rest in the platform secrets store
Use forModel names, sender addresses, feature flagsAPI keys, webhook signing secrets, tokens
In codectx.env.NAMEctx.env.NAME (identical)
  • Names use uppercase letters, digits and underscores; a name cannot be both a variable and a secret.
  • Platform-reserved prefixes (CUBIBASE_, AWS_) are rejected for your own values.
  • Saving a secret again under the same name rotates it. Deleting one destroys the encrypted value.
  • Values are snapshotted into each deployment. After changing configuration, redeploy so the active version picks it up — the Console tells you when this is needed.

What never happens

  • Secret values are never returned by read APIs, never included in deployment logs, and never sent to the browser after the initial save.
  • Execution logs are redacted: authorization headers, bearer tokens, API keys and common credential patterns are masked before storage.
  • One function cannot read another function’s secrets, and no function can read another project’s anything.
  • The HMAC signing secret is separate from your named secrets, shown once at creation/rotation, with the previous secret kept valid during rollover.

Additional resources