Environment Variables
This guide covers how to use environment variables within a Scout App.
Overview
Environment variables are a way to store configuration information that can be accessed by your app. They are useful for storing sensitive information, such as API keys, that you don't want to hardcode into your app, or for storing variables that you want to use across multiple apps.
Setting Environment Variables
To set environement variables in the Scout dashboard, navigate to the the environment variables tab on the settings page. You will be able to add environment variables on this page.
Accessing Environment Variables
After you have added an environment variable to you account, you can access it in your app by using the env
object, in your jinja templates.
For example, if you have an environment variable called API_KEY
, you can access it in your app like this:
{{ env.API_KEY }}
This is how it would look if you wanted to use the API_KEY
in an HTTP block.