Once off setup

The script properties are used to automatically renew oauth2 tokens when required, so the entire OAuth2 process is invisible to you. But first, you need to populate the script Properties by running a piece of code one time. You can delete it from your project once you've run it.

You need to make two changes to tailor it for you.

the fileId - set this to the file id of the JSON credentials file you downloaded from the console and moved to drive

packageName - this is how you will refer to this package in the future. I usually match the package name to the name I gave to the service account in the console, but you can call it what you like.