Environments
Environments let you manage different configurations for development, staging, and production.
Overview
Creating an Environment
- Click the Settings icon next to the environment selector
- Go to the Environments tab
- Click Add Environment
- Enter:
- Name: e.g., "Development"
- Color: Visual identifier
Switching Environments
Use the environment dropdown in the header to switch:
- Click the current environment name
- Select the desired environment
- All requests will use the new environment's variables
Environment Variables
Each environment can have its own variables:
Development
| Variable | Value |
|---|---|
API_URL | http://localhost:3000 |
DEBUG | true |
Staging
| Variable | Value |
|---|---|
API_URL | https://staging.example.com |
DEBUG | true |
Production
| Variable | Value |
|---|---|
API_URL | https://api.example.com |
DEBUG | false |
Variable Resolution
When you use {{API_URL}}:
- Check current environment for
API_URL - If not found, check global variables
- If still not found, leave as
{{API_URL}}
Example
Global: API_URL = https://default.example.com
Development: API_URL = http://localhost:3000
Production: (not set)
| Environment | {{API_URL}} resolves to |
|---|---|
| Development | http://localhost:3000 |
| Production | https://default.example.com |
| No environment | https://default.example.com |
Managing Environments
Editing
- Go to Environments tab
- Click on an environment
- Modify name, color, or variables
Duplicating
Right-click an environment and select Duplicate to create a copy with all variables.
Deleting
Click the trash icon to remove an environment. This doesn't affect global variables.
Color Coding
Each environment has a color for quick identification:
- Development (Green)
- Staging (Yellow)
- Production (Red)
The color appears:
- In the environment selector
- Next to variable badges in inputs
Workflow Example
Setup
- Create three environments: Dev, Staging, Prod
- Add environment-specific variables:
# Development
API_URL = http://localhost:3000
DATABASE = dev_db
# Staging
API_URL = https://staging.api.com
DATABASE = staging_db
# Production
API_URL = https://api.com
DATABASE = prod_db
Usage
- Develop and test with Development environment
- Test integration with Staging environment
- Verify production with Production environment
All requests use the same variable names, only values change.
Best Practices
Consistent Variables
Keep variable names consistent across environments. Only values should differ.
Production Safety
Use distinct colors (red) for production to prevent accidental requests.
Secrets per Environment
Each environment can have different API keys, tokens, etc.
Common Setup
| Variable | Development | Staging | Production |
|---|---|---|---|
API_URL | localhost:3000 | staging.api.com | api.com |
DEBUG | true | true | false |
LOG_LEVEL | debug | info | error |
API_KEY | dev-key | stg-key | prod-key |