Environment Variables
Environment variables allow you to keep sensitive information associated with your module safe. For example, they allow you to store and pass authentication credentials without exposing them directly in your code.
Create Environment Variables
- Select the back-end function within your module.
- Click "New Environment Variable".
- Define a Key (variable name)
- Define a Label - this is the display name of the key that will be displayed to project using the module containing the backend function.
Access Environment Variable in Code
Environment variables can be accessed in your code as process.env.<KEY>
Example:
const API_KEY = process.env.api_key