Google Authorize
Get an OAuth2 client with an authorized token to be used with Google APIs.
All I want for Christmas is to be able to easily start working with the Google APIs. There is a nice Node quickstart that Google provides for this. This module is a wrapper of that code but instead of executing a callback function that passes a resultant OAuth2 client, it returns a Promise that is thenable which resolves the OAuth2 client.
Here's how to use it:
Visit Node quickstart and complete Step 1 to get your client_secret.json.
npm i google-authorize --save
const GoogleAuthorize = ; // Use an array of scopes that correlate to to googleapi scopes// i.e. ['spreadsheets'] -> https://www.googleapis.com/auth/spreadsheetsconst googleAuth = 'spreadsheets'; // Authorize and then make a request to the sheets APIgoogleAuth; { var sheets = ; sheetsspreadsheetsvalues;} ## Change LogNov 6 2018 - Fixed undefined callback on fswriteFile