.ysl file and can contain both regular variables and encrypted secrets.
Understanding environments
An environment contains:- Variables: Non-sensitive values like API URLs, user IDs, timeouts
- Secrets: Sensitive values like API keys, tokens, passwords (stored securely)
Environment file structure
Environments are stored inyasumu/environment/*.ysl:
Creating environments
Create new environment
Click “New Environment” and provide a name (e.g., “Development”, “Staging”, “Production”).
Add secrets
Add sensitive values like API keys. These are stored securely and not committed to version control.
Programmatic environment management
Creating an environment
Listing environments
Getting a specific environment
Setting active environment
Updating an environment
Deleting an environment
Working with variables
TheEnvironmentVariable class provides methods to manage variables and secrets:
Setting variables
Getting variables
Deleting variables
Variable interpolation
Yasumu automatically interpolates variables in your requests using the{{VARIABLE_NAME}} syntax.
Using variables in requests
Interpolation syntax
Yasumu supports multiple interpolation patterns:Manual interpolation
Environment best practices
Separate concerns
Create distinct environments for each stage:Security considerations
- Use secrets for sensitive data: API keys, tokens, passwords should always be stored as secrets
- Don’t commit secrets: Secrets in
.yslfiles should be empty in version control - Local configuration: Team members set their own secret values locally
- Rotate credentials: Regularly update API tokens and passwords
Naming conventions
Toggle instead of delete
Common patterns
Base URL configuration
Dynamic authentication
Feature flags
Troubleshooting
Variable not interpolating
Variable shows {{VAR_NAME}} in response
This means the variable wasn’t found. Check:
- Variable name spelling
- Variable is enabled
- Environment is active
- Variable exists in current environment
Next steps
REST requests
Use variables in HTTP requests
Team collaboration
Share environments with your team