Environments are a resource used for managing different data sources, secrets, and published applications. They help you organize and switch between different configurations for development, testing, and production scenarios.
By default, two environments are created for you:
- Development - For building and testing applications
- Production - For live applications with production data
You can add, edit, or delete environments from Settings → Environments. This allows you to create custom environments that fit your workflow (e.g., Staging, Testing, QA).
Environments are particularly useful when working with data sources. You can define a single data source that connects to different databases or services across environments.
Example:
- Create a PostgreSQL data source in the Settings → Data Sources
- Add a development database connection URL for the Development environment
- Add a production database connection URL for the Production environment
This setup allows you to build and test applications using different data sets without changing your application code.
Similar to data sources, you can manage secrets (API keys, tokens, credentials) for different environments. This allows you to use different secret values across your development, staging, and production environments.
You can add, update, or delete secrets for any specific environment from Settings → Secrets Manager.
If you have a data source configured for multiple environments, you can switch between them while working on your application:
- Look for the conversation settings dropdown at the top center of the screen (next to your conversation name)
- Click the dropdown to open the conversation settings
- Use the Data Source Environment dropdown to select a different environment
- Your application will immediately switch to use the data from the selected environment
Best Practice: Keep your database schemas synchronized across all environments to ensure seamless switching between them.