var sheets = google.sheets('v4');
^
TypeError: google.sheets is not a function
I am using this startup tutorial Node.js Quickstart for Google spreadsheets. Is anyone else also facing this problem?
Authorize credentials for a desktop application If your app runs on multiple platforms, you must create a separate client ID for each platform. In the Google Cloud console, go to Menu menu > APIs & Services > Credentials. Click Create Credentials > OAuth client ID. Click Application type > Desktop app.
The Google Sheets API lets you read, write, and format Google Sheets data with your preferred programming language, including Java, JavaScript, and Python.
The issue is resolved. This issue was coming because of Google's API version v4 :
Need to use like var { google } = require("googleapis")
Thank you @Tanaike
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With