Environments
Environments let you define variables that are resolved in URLs, headers, and body content. Use them to switch between dev, staging, and production configurations instantly.
How Variables Work
Section titled “How Variables Work”Variables use {{variable_name}} syntax. When a request is sent, Flamingo replaces all {{variable_name}} occurrences with values from the active environment.
Global Environment
Section titled “Global Environment”Flamingo includes a Globals environment that is always available. Use it for values that do not change between environments.
Creating Environments
Section titled “Creating Environments”- Open the sidebar and click the Environments panel (beaker icon)
- Click New Environment
- Type a name and press Enter
- Add variables using the key-value editor
Variable Editor
Section titled “Variable Editor”Each environment shows its variables in an editable list:
| Variable | Value |
|---|---|
base_url | api.example.com |
api_key | sk-abc123 |
token | jwt-token-here |
Toggle the environment’s checkbox to activate it. Only one environment can be active at a time (plus Globals).
Switching Environments
Section titled “Switching Environments”Select an environment from the dropdown in the title bar. The active environment’s color indicator appears next to its name.
Example
Section titled “Example”// Environment: Development// base_url = dev-api.example.com// api_key = dev-key-123
// Environment: Production// base_url = api.example.com// api_key = prod-key-456
// Request URL: https://{{base_url}}/users// Header: X-API-Key: {{api_key}}
// With Development active:// URL: https://dev-api.example.com/users// Header: X-API-Key: dev-key-123
// With Production active:// URL: https://api.example.com/users// Header: X-API-Key: prod-key-456Variable Resolution
Section titled “Variable Resolution”Variables are resolved in:
- URL
- Query parameters (key and value)
- Headers (key and value)
- Body content (JSON, XML, text, form-data, URL-encoded)
- Authentication fields