-
GO TO 'https://developers.google.com/gmail/api/quickstart/nodejs'
-
click the button 'Enable the gmail API'
-
Download the credential.json, and put the file into this folder
-
Delete the 'TOKEN.json' first if it exists.
-
-> npm install
-
-> npm run start
-
click the authoriz website showed in console .
-
It would generate a new TOKEN.json after STEP 4, the new file includes ACCESS_TOKEN, REFRESH_TOKEN, blabla...