Deploying a GCP function that uses the Node.js SDK
Deploying a GCP function that uses the Node.js SDK
To use the Node.js SDK, you must supply service account credentials via an environment variable or constructor. Do the following to use an environment variable for the service account JSON file:
Save your credentials JSON file in your function’s directory (i.e., in the same folder with the entry point index.js file). In this example, it will be saved in a file named
dev-credentials.json
in alib
folder.When deploying your function with the
gcloud functions deploy
command, use the--set-env-vars
flag to set the path. It must be prefixed with/workspace
to work correctly. Example:--set-env-vars CLEARBLADE_CONFIGURATION=/workspace/lib/dev-credentials.json
.
, multiple selections available,
Related content
Creating a Google Cloud service account key
Creating a Google Cloud service account key
More like this
Publishing over MQTT
Publishing over MQTT
Read with this
Implementing exponential backoff
Implementing exponential backoff
Read with this
Authenticating applications
Authenticating applications
More like this
projects.locations.registries.devices
projects.locations.registries.devices
Read with this
ClearBlade config
ClearBlade config
More like this