Skip to content
Start here

Secrets

List script secrets
client.workers.scripts.secrets.list(stringscriptName, SecretListParams { account_id } params, RequestOptionsoptions?): SinglePage<SecretListResponse>
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets
Get secret binding
client.workers.scripts.secrets.get(stringscriptName, stringsecretName, SecretGetParams { account_id, url_encoded } params, RequestOptionsoptions?): SecretGetResponse
GET/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
Add script secret
client.workers.scripts.secrets.update(stringscriptName, SecretUpdateParamsparams, RequestOptionsoptions?): SecretUpdateResponse
PUT/accounts/{account_id}/workers/scripts/{script_name}/secrets
Delete script secret
client.workers.scripts.secrets.delete(stringscriptName, stringsecretName, SecretDeleteParams { account_id, url_encoded } params, RequestOptionsoptions?): SecretDeleteResponse | null
DELETE/accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name}
ModelsExpand Collapse
SecretListResponse = WorkersBindingKindSecretText { name, text, type } | WorkersBindingKindSecretKey { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
WorkersBindingKindSecretText { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

WorkersBindingKindSecretKey { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" | "pkcs8" | "spki" | "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: Array<"encrypt" | "decrypt" | "sign" | 5 more>

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64?: string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk?: unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretGetResponse = WorkersBindingKindSecretText { name, text, type } | WorkersBindingKindSecretKey { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
WorkersBindingKindSecretText { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

WorkersBindingKindSecretKey { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" | "pkcs8" | "spki" | "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: Array<"encrypt" | "decrypt" | "sign" | 5 more>

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64?: string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk?: unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretUpdateResponse = WorkersBindingKindSecretText { name, text, type } | WorkersBindingKindSecretKey { algorithm, format, name, 4 more }

A secret value accessible through a binding.

One of the following:
WorkersBindingKindSecretText { name, text, type }
name: string

A JavaScript variable name for the binding.

text: string

The secret value to use.

type: "secret_text"

The kind of resource that the binding provides.

WorkersBindingKindSecretKey { algorithm, format, name, 4 more }
algorithm: unknown

Algorithm-specific key parameters. Learn more.

format: "raw" | "pkcs8" | "spki" | "jwk"

Data format of the key. Learn more.

One of the following:
"raw"
"pkcs8"
"spki"
"jwk"
name: string

A JavaScript variable name for the binding.

type: "secret_key"

The kind of resource that the binding provides.

usages: Array<"encrypt" | "decrypt" | "sign" | 5 more>

Allowed operations with the key. Learn more.

One of the following:
"encrypt"
"decrypt"
"sign"
"verify"
"deriveKey"
"deriveBits"
"wrapKey"
"unwrapKey"
key_base64?: string

Base64-encoded key data. Required if format is “raw”, “pkcs8”, or “spki”.

key_jwk?: unknown

Key data in JSON Web Key format. Required if format is “jwk”.

SecretDeleteResponse = unknown