Environment Variables

Environment variables are a fundamental aspect of our platform, allowing you to configure and customize various aspects of your application's behavior.

Managing Environment Variables

Environment variables can be configured either during application creation or via the Environments section in the user interface sidebar.

Application create screen

The section for environment variables can be found at the bottom of the application creation page.

1. Click + Add environment

2. Insert KEY and VALUE

Application sidebar

The section for environment variables for already created applications can be found in the sidebar of the application -> section Environments . From this place, you can create, edit, or delete existing environments.

Accessing Environment Variables

Once an environment variable is set, you can access its value within your application's code. The method for accessing environment variables depends on the programming language or framework you are using. However, most languages provide a straightforward way to access environment variables, such as process.env in Node.js or os.environ in Python.

Common Use Cases

Environment variables are commonly used for:

  • Storing sensitive information, such as API keys or database credentials, without hardcoding them into your application's source code.

  • Configuring different settings for development, staging, and production environments.

  • Enabling feature flags or toggles to control specific functionality.

  • Providing customization options for your application's behavior.

Best Practices

To make the most of environment variables, consider the following best practices:

  1. Use meaningful and descriptive names for your variables.

  2. Ensure sensitive information is properly secured and not exposed in log files or error messages.

  3. Document the required variables and their purpose for easy reference and onboarding of new team members.

By utilizing environment variables effectively, you can enhance the flexibility and security of your applications, enabling easier configuration and deployment across various environments.

Last updated