GeezerVison is showing adk.dev — SecretManagerClient | ADK for TypeScript: API Reference - v2.5.0
Class SecretManagerClient
Reads secrets from Google Cloud Secret Manager.
The client authenticates with serviceAccountJson when it is set, then with
authToken, and otherwise with application default credentials.
@google-cloud/secret-manager is an optional peer dependency. It is loaded
on the first call to SecretManagerClient.getSecret, so constructing
the client does not require it.
Constructors
constructor
-
Returns SecretManagerClient
Throws
Invalid service account JSON: ... when serviceAccountJson
does not parse.
Methods
getSecret
-
getSecret(resourceName: string): Promise<string>
Returns the payload of a secret version as a UTF-8 string.
Parameters
- resourceName: string
The secret version, in the form
projects/{project}/secrets/{secret}/versions/{version}. Use
latest as the version to read the newest one.
Returns Promise<string>
Throws
When default credentials are needed and cannot be resolved, or
when Secret Manager returns an error, such as a missing secret or a
denied permission.