adk-typescript
Version:
TypeScript port of Google's Agent Development Kit (ADK)
32 lines (31 loc) • 1.4 kB
TypeScript
/**
* A client for interacting with Google Cloud Secret Manager.
*
* This class provides a simplified interface for retrieving secrets from
* Secret Manager, handling authentication using either a service account
* JSON keyfile (passed as a string) or a pre-existing authorization token.
*/
export declare class SecretManagerClient {
private credentials;
/**
* Initializes the SecretManagerClient.
*
* @param params Configuration parameters
* @param params.serviceAccountJson The content of a service account JSON keyfile (as a string), not the file path. Must be valid JSON.
* @param params.authToken An existing Google Cloud authorization token.
* @throws Error if neither serviceAccountJson nor authToken is provided, or if both are provided. Also raised if the serviceAccountJson is not valid JSON.
*/
constructor(params: {
serviceAccountJson?: string;
authToken?: string;
});
/**
* Retrieves a secret from Google Cloud Secret Manager.
*
* @param resourceName The full resource name of the secret.
* Usually you want the "latest" version, e.g., "projects/my-project/secrets/my-secret/versions/latest".
* @returns The secret payload as a string.
* @throws Error if the Secret Manager API returns an error
*/
getSecret(resourceName: string): Promise<string>;
}