--- title: "Secret" hideTitleOnPage: true --- ## SecretService Service for managing project-scoped secrets. ### Constructors #### Constructor ```ts new SecretService(api: AxiosInstance): SecretService; ``` **Parameters**: - `api` _AxiosInstance_ **Returns**: - `SecretService` ### Methods #### delete() ```ts delete(name: string): Promise; ``` **Parameters**: - `name` _string_ **Returns**: - `Promise` #### get() ```ts get(name: string): Promise; ``` Gets one secret's metadata (never its value). **Parameters**: - `name` _string_ **Returns**: - `Promise` #### iter() ```ts iter(options: ListSecretsOptions = {}): AsyncIterable; ``` **Parameters**: - `options` _ListSecretsOptions = \{\}_ **Returns**: - `AsyncIterable` #### list() ```ts list(options: ListSecretsOptions = {}): Promise>; ``` Lists secret metadata for the project (never values). **Parameters**: - `options` _ListSecretsOptions = \{\}_ **Returns**: - `Promise>` #### set() ```ts set(name: string, value: string, options: SetSecretOptions): Promise; ``` Creates or updates a secret's value + metadata. **Parameters**: - `name` _string_ - `value` _string_ - `options` _SetSecretOptions_ **Returns**: - `Promise` *** ## ListSecretsOptions **Properties**: - `cursor?` _string_ - `limit?` _number_ *** ## Secret ```ts type Secret = SecretDto ``` Secret metadata (never the value). *** ## SetSecretOptions Options for creating/updating a secret. **Properties**: - `allowedDomains` _string\[\]_ - The hosts where this secret's value may be sent (exact or `*.` wildcard), or `["*"]` for any verified host. `"*"` lets the value reach any HTTPS host, including one a compromised sandbox controls. - `description?` _string_ - `ifNotExists?` _boolean_ *** ## SecretDto **Properties**: - `name` _string_ - `allowed_domains` _string\[\]_ - `description` _string \| null_ - `created_at` _string \| null_ - `updated_at` _string \| null_ *** ## SecretMeta ```ts type SecretMeta = SecretDto ``` `GET /secrets/{name}` detail row — the same SDK shape as the list row.