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

Recently I needed to set the Gmail signature for all the users in the business. I found a number of tools online to do this, but they all seemed bloated with subscription based features cost I simply can’t justify.

All I needed was an easy way to set our users’ signatures, so I set out to write my own utility to do this. I used Node.js to connect to the Gmail API using a Service Account Key. Below is an example of how I got this working.