Committing psuedo functional GCal Pull
It's not exactly a good test, but it's something. Need to do some more work in the creation and management of calendars.
This commit is contained in:
parent
97af77745f
commit
b2b8bccaa6
27
calendarpulltest.js
Normal file
27
calendarpulltest.js
Normal file
@ -0,0 +1,27 @@
|
||||
const { google } = require('googleapis');
|
||||
const { googlePrivateKey, googleClientEmail, googleProjectNumber } = require('./config.json');
|
||||
|
||||
const SCOPES = ['https://www.googleapis.com/auth/calendar'];
|
||||
|
||||
async function main() {
|
||||
const jwtClient = new google.auth.JWT(
|
||||
googleClientEmail,
|
||||
null,
|
||||
googlePrivateKey,
|
||||
SCOPES,
|
||||
);
|
||||
|
||||
const calendar = new google.calendar({
|
||||
version: 'v3',
|
||||
project: googleProjectNumber,
|
||||
auth: jwtClient,
|
||||
});
|
||||
|
||||
const response = calendar.calendarList.list({});
|
||||
console.log('Output: ' + response.data);
|
||||
}
|
||||
|
||||
main().catch(e => {
|
||||
console.error(e);
|
||||
throw e;
|
||||
});
|
Loading…
Reference in New Issue
Block a user