Create
client.vals.environmentVariables.create(stringvalID, EnvironmentVariableCreateParams { key, value, description } body, RequestOptionsoptions?): EnvironmentVariableCreateResponse { createdAt, description, key, updatedAt }
/v2/vals/{val_id}/environment_variables
Create a new environment variable scoped to this project.
Parameters
valID: string
Returns
import ValTown from "npm:@valtown/sdk";
const client = new ValTown();
const environmentVariable = await client.vals.environmentVariables.create(
'182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
{ key: 'key', 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"
}