Retrieve secrets in Cloud Code

Both Cloud Code modules and scripts can access secrets stored in Secret Manager. The following sections describe how to retrieve secrets in Cloud Code modules and scripts. Use Secret Manager to store sensitive information, such as API keys, service account credentials, and other sensitive data.

SectionDescription
Retrieve secrets in Cloud Code modulesRetrieve secrets stored in Secret Manager from a Cloud Code module.
Retrieve secrets in Cloud Code scriptsRetrieve secrets stored in Secret Manager from a Cloud Code script.

Prerequisites

You should be familiar with setting up Cloud Code resources. Refer to Getting started with modules or Getting started with scripts for more information.