How to access a gmail account I own using Gmail API? : <p>I want to run a node script as a cronjob which uses Gmail's API to poll a gmail account I own.</p>

<p>I am following <a href="https://developers.google.com/gmail/api/quickstart/nodejs#prerequisites" rel="noreferrer">these quickstart instructions</a>:</p>

<p><a href="https://i.stack.imgur.com/0EgAo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0EgAo.png" alt="quickstart"></a></p>

<p>I'm stuck on the first step.  When requesting credentials for a cron script it tells me that "User data cannot be accessed from a platform without a UI because it requires user interaction for sign-in":</p>

<p><a href="https://i.stack.imgur.com/LUh8X.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LUh8X.png" alt="enter image description here"></a>  </p>

<p>The docs are confusing in general, and mention "service accounts," "OAuth," and other things -- I cannot tell which apply to my use-case and which don't.  I've used many SaaS APIs, and the typical workflow is to login to your account, get an API key and secret, and use those in your script to access the API.  It seems this is <em>not</em> the paradigm used by the Gmail API, so I'd appreciate any guidance or links to clearer instructions.</p>
