取得 Google Sheets 憑證的官方教學
Google Cloud Console 首頁
應用程式憑證的授權有效期限
官方文件中安裝 googleapis 套件的指令:yarn add googleapis@39
Google Sheets 官方範例程式
測試 Google Sheets 官方範例程式:node tools/google_sheets/index.js
- 請先申請好 Google Sheets API 憑證,並將憑證放置「tools/google_sheets」資料夾內
- 申請到的「credentials.json」憑證可在後續的章節使用無需再次申請。
- 記得先在終端機輸入
yarn
將套件安裝 - 套件安裝完後在終端機輸入
node tools/google_sheets/index.js
即可執行