ADK for TypeScript: API Reference
    Preparing search index...

    Interface BaseCredentialService

    Abstract class for Service that loads / saves tool credentials from / to the backend credential store.

    interface BaseCredentialService {
        loadCredential(
            authConfig: AuthConfig,
            toolContext: Context,
        ): Promise<AuthCredential | undefined>;
        saveCredential(authConfig: AuthConfig, toolContext: Context): Promise<void>;
    }

    Methods

    • Loads the credential by auth config and current tool context from the backend credential store.

      Parameters

      • authConfig: AuthConfig

        The auth config which contains the auth scheme and auth credential information. auth_config.get_credential_key will be used to build the key to load the credential.

      • toolContext: Context

        The context of the current invocation when the tool is trying to load the credential.

      Returns Promise<AuthCredential | undefined>

      A promise that resolves to the credential saved in the store.