1.0.2 • Published 5 years ago

google-cloud-json-environment-credential v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

google-cloud-json-environment-credential

Rationale: Provides a few different options for configuring Google Cloud credetials.

Usage:

let gc_config = require('google-cloud-json-environment-credential')

gc_config.configure()

OR

gc_config.configure(<file path of local credentials.json>)

Flow

If the environment variable GOOGLE_APPLICATION_CREDENTIALS is set this script returns without doing anything.

If the environment variable GOOGLE_APPLICATION_CREDENTIALS_JSON is set, this script will save the JSON to a local temp file and set GOOGLE_APPLICATION_CREDENTIALS with that file's path.

If the optional credentialsJsonFile parameter is passed to this script it will set GOOGLE_APPLICATION_CREDENTIALS to that value.

If none of the above apply GOOGLE_APPLICATION_CREDENTIALS will be set to credentials.json and hope for the best.