google-cloud-json-environment-credential

1.0.2 • Public • Published

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.

Package Sidebar

Install

npm i google-cloud-json-environment-credential

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

3.61 kB

Total Files

4

Last publish

Collaborators

  • georgecoller