Skip to main content
Environment secrets hold sensitive configuration values, such as API keys, passwords, or tokens. Your script reads them at runtime, so they never have to appear in your source code. Unlike environment variables, secrets cannot be viewed once they are set. You can only update or delete them, which keeps the value hidden even from people with dashboard access.

Adding environment secrets

To add a secret to your script:
  1. Log in to the bunny.net dashboard.
  2. Select Edge Platform, click on Scripting, and select the script.
  1. Select Env Configuration and Environment Secrets, and fill in the details of the secret you want to create.
  1. Click Save Secret.

Using environment secrets

Environment secrets are accessed in the same way as environment variables, using either the Node.js process module or Deno.env.
You can also use Deno.env.get():
Names of environment variables and secrets on the same script must be unique. You cannot use the same name for both a variable and a secret.
Last modified on August 17, 2026