Skip to main content

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:

  1. Click "Environments" in the sidebar
  2. Click "New Environment"
  3. Give your environment a name (e.g., "Development", "Production")
  4. Add variables as key-value pairs
  5. Click "Save"

Environment Variables

Variables in an environment are defined as key-value pairs:

Variable NameValueDescription
baseUrlhttps://api.dev.example.comBase API URL
apiKeydev_abc123API authentication key
timeout5000Request 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)

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)

Creating Parent Environments

  1. Create a parent environment with common variables
  2. When creating a child environment, select the parent
  3. Override only the variables that differ
  4. 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:

  1. Global: Available in all environments
  2. Environment: Specific to the selected environment
  3. Collection: Scoped to a specific collection
  4. 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:

  1. Right-click an environment
  2. Select "Duplicate"
  3. 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