googleapis-jwt-authorizer
v0.0.8
Published
Google API JWT authenticator
Downloads
4
Maintainers
Readme
GAPI Service account authorizer
Provides auto authorization for googleapis.
Usage:
var googleapis = require('googleapis'); // enable gapi client
var drive = googleapis.drive('v3'); // enable drive api
// enable auto authorizer
var authorizer = require('googleapis-jwt-authorizer');
authorizer.init({
googleapis:googleapis, // pass gapi instance to authorizer
key: '/absolute/path/to/google/servcieaccount/pem/keyfile',
email: '[email protected]',
scopes: ['https://www.googleapis.com/auth/drive']
});
// every success auth attempt
authorizer.events.on('authorized', auth = {
console.log('Authorized! =)')
});