Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using google oauth2 for spreadsheets getting an error "google.sheets is not a function"

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?

like image 278
Himanshu Teotia Avatar asked Feb 17 '18 14:02

Himanshu Teotia


People also ask

How do I authenticate a Google sheet?

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.

Does Google Sheets support API?

The Google Sheets API lets you read, write, and format Google Sheets data with your preferred programming language, including Java, JavaScript, and Python.


1 Answers

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

like image 174
Himanshu Teotia Avatar answered Oct 15 '22 11:10

Himanshu Teotia