Set and manage environment variables for your app configurations.
.env
file to pass environment variables to the application; you must set them in Sevalla. You can import the contents of a .env
file when you add environment variables.Environment variables for your application.
_
). Environment variable values are applied literally, with the exception of parentheses, commas, and double quotes.
write_stock,read_orders
will cause the rollout process to fail.\
) like this: write_stock\,read_orders
— which will be applied as write_stock,read_orders
."my_example_variable"
will be applied as my_example_variable
.\
) like this: \"my_example_var\"
— which will be applied as "my_example_var"
.my_exampl"e_text
), the rollout process will fail.\
) like this: my_examp\"le_var
— which will be applied as my_examp"le_var
.${key}
format. For example, to reference an environment variable with the key DB_PASSWORD
use ${DB_PASSWORD}
.
To add multiple environment variables, copy the keys and values using CMD + C (Mac) or CTRL + C (Windows), and in the Add environment variable window, press CMD + V (Mac) or CTRL + V (Windows). You can also paste the contents of a .env
file or import the .env
file using Import .env.
Add environment variables to your application after deployment.
API_KEY
with process.env.API_KEY
. In PHP, you would use getenv('API_KEY')
.
SVL_COMPANY_ID
SVL_APP_ID
SVL_APP_NAME
SVL_PROCESS_ID
SVL_PROCESS_TYPE
SVL_DEPLOYMENT_ID
SVL_DEPLOYMENT_INITIATED_BY
SVL_DEPLOYMENT_TRIGGER
SVL_DEPLOYMENT_COMMIT_SHA
SVL_DEPLOYMENT_BRANCH
SVL_DEPLOYMENT_DOCKER_IMAGE
PORT
as the port used by the web server. If you’d like your application to interact with the web server, you will need to use this environment variable. For example, in Node.js, this is how you would start a server:
NODE_ENV
environment variable is not set to production
for Node.js applications; you must add this environment variable manually.
Language | Code |
---|---|
Ruby | ENV["API_KEY"] |
Node.js | process.env.API_KEY; |
Python | os.environ.get('API_KEY') |
Java | System.getenv("API_KEY"); |
Scala | System.getenv("API_KEY"); |
PHP | getenv('API_KEY'); |
Go | os.Getenv("API_KEY") |