How to connect to the G Suite APIs using a service account key with Node.js

Getting set up in Google Cloud Platform and G Suite

  1. Head over to the GCP console and make a new project. You can call it anything you like.
  2. Next go to the APIs & Services Dashboard:
GCP APIs & Services Dashboard
GCP APIs Dashboard
APIs & Services Credentials
GCP Service account email
G Suite Admin API Client settings

Connecting with Node.js

Now that your Service Account Key is set up in GCP and G Suite we can connect with Node.js. To do this we use the private key for the service account (downloaded in step 6) to form a JWT client which we will use for authentication with subsequent requests.



More about me at

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store