Skip to content

Instantly share code, notes, and snippets.

const { google } = require('googleapis');
const privatekey = require('./private-key.json'); // This was downloaded when you created your Service Account Key
const scopes = ['https://www.googleapis.com/auth/gmail.settings.basic'];
const auth = async (user) => {
try {
const jwtClient = new google.auth.JWT(