Breadbot/calendarpulltest.js
Bradley Bickford b2b8bccaa6 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.
2022-11-20 19:04:47 -05:00

27 lines
589 B
JavaScript

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;
});