With gcloud-node it's incredibly easy to get authenticated and start using Google's APIs. You can set your credentials on a global basis as well as on a per-API basis. See each individual API section below to see how you can auth on a per-API-basis. This is useful if you want to use different accounts for different Google Cloud services.
var config = {
projectId: 'grape-spaceship-123',
keyFilename: '/path/to/keyfile.json'
};
var gcloud = require('gcloud')(config);A config object requires the following properties:
projectId
If you wish, you can set an environment variable (GCLOUD_PROJECT) in place of specifying this inline.
- One of the following:
config.credentialsobject containingclient_emailandprivate_keyproperties.config.keyFilenamepath to a .json, .pem, or .p12 key file.GOOGLE_APPLICATION_CREDENTIALSenvironment variable with a full path to your key file.
Note: When using a .pem or .p12 key file, config.email is also required.