Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Snippet for "Integrating Google Calendar (G-suite) in Node"
from google.oauth2 import service_account
from googleapiclient.discovery import build
SCOPES = ['']
SERVICE_ACCOUNT_FILE = './xxxxxxxxxxxx.json' # You should make it an environment variable
credentials = service_account.Credentials.from_service_account_file(SERVICE_ACCOUNT_FILE, scopes=SCOPES)
delegated_credentials = credentials.with_subject('melvin@xxxxxxxx.xx')
service = build('calendar', 'v3', credentials=delegated_credentials)
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.