/
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
projects.locations.registries.devices
projects.locations.registries.devices
Read with this
Publishing over MQTT
Publishing over MQTT
Read with this
Implementing exponential backoff
Implementing exponential backoff
Read with this
Getting device state
Getting device state
Read with this
Resources
Resources
Read with this
Viewing device logs
Viewing device logs
Read with this