Environment Files
Environment Files
Section titled “Environment Files”rext.env.json
Section titled “rext.env.json”Define variables per environment in a rext.env.json file at the root of your project:
{ "Development": { "baseUrl": "http://localhost:3000", "apiKey": "dev-key-123" }, "Staging": { "baseUrl": "https://staging.api.example.com", "apiKey": "stg-key-456" }, "Production": { "baseUrl": "https://api.example.com", "apiKey": "prod-key-789" }}Switching Environments
Section titled “Switching Environments”You can switch between environments using:
- Status Bar — Click the environment selector at the bottom of VS Code
- Sidebar — Select the environment from the Rext sidebar panel
- Command Palette — Run
Rext: Switch Environment
Once an environment is active, its variables are available via the {{variable}} syntax:
GET {{baseUrl}}/usersAuthorization: Bearer {{apiKey}}When the Development environment is active, this resolves to:
GET http://localhost:3000/usersAuthorization: Bearer dev-key-123Security
Section titled “Security”rext.env.jsonEnvironment files stay entirely local. Rext never syncs, uploads, or transmits your environment data.
Next Steps
Section titled “Next Steps”- Learn about variable scopes
- Explore shared configuration with
@config