Skip to content
  • Auto
  • Light
  • Dark
Get Started
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Update

client.vals.environmentVariables.update(stringkey, EnvironmentVariableUpdateParams { val_id, value, description } params, RequestOptionsoptions?): EnvironmentVariableUpdateResponse { createdAt, description, key, updatedAt }
put/v2/vals/{val_id}/environment_variables/{key}

Update a environment variable scoped to this project.

ParametersExpand Collapse
key: string
params: EnvironmentVariableUpdateParams { val_id, value, description }
val_id: string

Path param: Id of a val

formatuuid
value: string

Body param: Value of the environment variable.

maxLength8192
description?: string

Body param: Optional description of the environment variable

maxLength1024
ReturnsExpand Collapse
EnvironmentVariableUpdateResponse { createdAt, description, key, updatedAt }

An environment variable

createdAt: string
description: string | null

Optional description of the environment variable

maxLength1024
key: string

Name or key of the environment variable, accessible via Deno.env or process.env

maxLength8192
updatedAt: string
import ValTown from "npm:@valtown/sdk";

const client = new ValTown();

const environmentVariable = await client.vals.environmentVariables.update('key', {
  val_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  value: 'value',
});

console.log(environmentVariable.createdAt);
{
  "createdAt": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "key": "key",
  "updatedAt": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "createdAt": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "key": "key",
  "updatedAt": "2019-12-27T18:11:19.117Z"
}