Set environment variables
set_envAdd, update, or remove a spawnpoint project's environment variables without a redeploy: set upserts variables (everything not named is untouched), unset removes by name. Values are stored sealed, survive every later redeploy, and reach the app as its environment variables; a running app is restarted with the new environment right away, and a sleeping project is woken to apply it, so expect the call to take a few seconds. During a deploy in progress the change is saved and applies when that deploy finishes; a project whose deploy failed stores it for its next deploy; a terminated project keeps no variables, so nothing is stored, and a new deploy under its name starts with none. The note says which happened, and none of these is a failure. deploy_project's env parameter feeds the same store, so pass env at deploy time when you have it and use this tool to change a variable on a live app. Returns the variable names now set; values are write-only and never returned. Never hardcode a secret into a project file; set it here instead. Refused on a static site, which runs nothing that could read a variable.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| set | No | variables to add or update, name to value. Merged with what is already stored: variables not named here are untouched | |
| unset | No | variable names to remove. A name may not also appear in set: such a call is refused. A name that is not set is ignored, and a call that only unsets such names changes nothing and does not restart the app | |
| project_id | Yes | the id of the project |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| names | Yes | ||
| project_id | Yes |