Environments
Environments in Nidra allow you to manage different sets of variables for different contexts, such as development, staging, and production.
What is an Environment?
An environment is a collection of variables that can be used in requests. Environments enable you to:
- Switch between development, staging, and production configurations
- Share common variables across multiple requests
- Maintain separate credentials for different environments
- Test the same requests against different servers
Creating Environments
To create a new environment:
- Click "Environments" in the sidebar
- Click "New Environment"
- Give your environment a name (e.g., "Development", "Production")
- Add variables as key-value pairs
- Click "Save"
Environment Variables
Variables in an environment are defined as key-value pairs:
| Variable Name | Value | Description |
|---|---|---|
baseUrl | https://api.dev.example.com | Base API URL |
apiKey | dev_abc123 | API authentication key |
timeout | 5000 | Request timeout in ms |
Variable Types
- String: Text values
- Number: Numeric values
- Boolean: true/false
- Secret: Masked values for sensitive data
Using Variables
Reference variables in requests using double curly braces:
{{baseUrl}}/users/{{userId}}
Learn more about variable syntax →
Parent Environments
One of Nidra's powerful features is parent environments, which allow environment inheritance.
What are Parent Environments?
Parent environments let you create a hierarchy where child environments inherit variables from their parent, but can override specific values.
Use Cases
Example: Multi-region deployment
- Parent:
Production(contains common production variables)- Child:
Production-US(overrides region-specific values) - Child:
Production-EU(overrides region-specific values)
- Child:
Example: Shared configuration
- Parent:
Common(shared API keys, common headers)- Child:
Development(dev server URLs) - Child:
Staging(staging server URLs) - Child:
Production(production server URLs)
- Child:
Creating Parent Environments
- Create a parent environment with common variables
- When creating a child environment, select the parent
- Override only the variables that differ
- Inherited variables are shown but can't be edited in the child
Learn more about parent environments →
Switching Environments
Switch between environments using:
- The environment dropdown in the toolbar
- Keyboard shortcuts
- Right-click menu in the environments list
The active environment is highlighted and its variables are used in all requests.
Environment Scope
Variables can exist at different scopes:
- Global: Available in all environments
- Environment: Specific to the selected environment
- Collection: Scoped to a specific collection
- Request: Local to a single request
Variable precedence (highest to lowest): Request > Collection > Environment > Global
Managing Sensitive Data
For API keys, tokens, and other sensitive data:
- Mark variables as "Secret" to mask their values
- Never commit sensitive values to version control
- Use different credentials for each environment
- Rotate credentials regularly
Duplicating Environments
Quickly create similar environments:
- Right-click an environment
- Select "Duplicate"
- Modify the duplicated environment as needed
Exporting and Importing
Share environments with your team:
- Export environments as JSON
- Import environments from files
- Sync environments with Team Sync
Best Practices
- Use descriptive names: Make it clear what each environment is for
- Minimize duplication: Use parent environments for shared configuration
- Document variables: Add descriptions explaining what each variable does
- Secure sensitive data: Mark secrets appropriately
- Keep environments in sync: Ensure all environments have the same variable names (but different values)
Next Steps
- Learn about using variables in requests →
- Explore parent environment patterns →
- Check the variable reference →