Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To use the Node.js SDK, you must supply service account credentials via an environment variable or constructor. If you want Do the following to use an environment variable for the service account JSON file, you’ll need to do the following:

  1. 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 a lib folder.

  2. 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.