Skip to content

Environment Files

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"
}
}

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}}/users
Authorization: Bearer {{apiKey}}

When the Development environment is active, this resolves to:

GET http://localhost:3000/users
Authorization: Bearer dev-key-123
.gitignore
rext.env.json

Environment files stay entirely local. Rext never syncs, uploads, or transmits your environment data.