Last active
October 14, 2019 13:50
-
-
Save wilcoschoneveld/358cab318f40bb97c419dc0f0aac2c56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a new GoogleAuth instance with service-account credentials from a json file. | |
// Note: credential file location must be set in GOOGLE_APPLICATION_CREDENTIALS env variable | |
const auth = new google.auth.GoogleAuth({ | |
scopes: ['https://www.googleapis.com/auth/calendar'], | |
clientOptions: { | |
// Overwrite JWT subject to 'impersonate' calendar user | |
subject: '[email protected]' | |
} | |
}); | |
this.calendar = google.calendar({ | |
version: 'v3', | |
auth: await auth.getClient() | |
}); | |
this.schedule.scheduleIntervalJob('poller', this.POLLING_INTERVAL, () => this.pollCalendarEvents()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment