Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Snippet for "Integrating Google Calendar (G-suite) in Node" https://hackernoon.com/my-journey-integrating-google-calendar-g-suite-in-node-62fbc8596455
const google = require("googleapis").google;
const calendar = google.calendar("v3");
(async function () {
const scopes = ['https://www.googleapis.com/auth/calendar'];
const keyFile = './xxxxxxxxxxx.json'; // Your should make it an environment variable
const client = await google.auth.getClient({
keyFile,
scopes,
});
// Delegated Credential
client.subject = "melvin@xxxxxxxxx.xx";
const res = await calendar.calendarList.list({
auth: client
});
console.log(JSON.stringify(res.data));
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.