Skip to content

devilelephant/google-cloud-json-environment-credential

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Use an environment variable to configure a Node JS Google Cloud client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published