Skip to main content
Environment variables hold configuration data that your script reads at runtime. Because the values live outside the code, they never end up committed to your script or your version control system.
For sensitive data such as API keys, passwords, or tokens, use environment secrets instead. Secrets are encrypted and cannot be viewed once set.

Adding environment variables

To add a variable 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 Variables, and fill in the details of the variable you want to create.
  1. Click Save.

Using environment variables

Read the value in your script with either the Node.js process module or Deno.env. This example uses the process module:
This one does the same thing with Deno.env:
Last modified on August 17, 2026