env
Environment variables, secrets, config and integration keys. It sets with project_id, key and value; deletes with key and delete:true; lists with project_id only. Values are encrypted and omitted from list results. New values are private for server functions by default. A VITE_ or REACT_APP_ prefix alone never publishes a value. Publishing a browser value requires a prefixed name and public:true. Recognized secret credentials, including test credentials, cannot be marked public. Server functions read sw.env.NAME. Browser code reads import.meta.env.VITE_NAME or process.env.REACT_APP_NAME only for explicitly public values. A private browser reference refuses compilation. Provider and purpose are optional descriptive labels, not access controls. After the project adopts live config on a deploy, saves reach new ordinary requests within 60 seconds, usually in a few seconds. Cron and new background deliveries see changes within 5 seconds. Public browser values reach new page loads within 60 seconds. Previews keep the config they captured. List and save responses contain exact references and effective visibility, never values. A project's combined environment values have a 5,120 byte limit.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>"
},
"name": "env"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Variable name, e.g. "STRIPE_SECRET_KEY" | |
| scope | No | Optional scope. 'all' (default) applies to live and any enabled preview. 'prod' restricts the value to live. 'dev' requires hosted preview access for signed-in accounts on every plan. | |
| value | No | Variable value (will be encrypted). Required when setting. | |
| delete | No | true deletes the variable specified by key. | |
| public | No | Explicit browser visibility. New values default private; omitted on rotation preserves current visibility. Requires a VITE_/REACT_APP_ name. Recognized credentials cannot be public. | |
| purpose | No | Optional non-secret description (max 240 characters). Omitted: retained; empty string clears. | |
| provider | No | Optional non-secret integration label (max 64 characters). Omitted: retained; empty string clears. | |
| project_id | Yes | Project ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them). |