menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Productivity News

>

Write to G...
source image

Dev

1M

read

95

img
dot

Image Credit: Dev

Write to Google Sheets from a local script via gcloud CLI authentication

  • To authenticate and write to Google Sheets from a local script via gcloud CLI, you can use the gcloud CLI's application default credentials.
  • Enable the Sheets API in your Cloud project by running the command 'gcloud services enable sheets.googleapis.com'.
  • Set your application default credentials and claim the necessary OAuth scopes by running 'gcloud auth application-default login --scopes "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/spreadsheets"'.
  • Initialize a Node client for Google Sheets by importing googleapis and configuring the necessary scopes.

Read Full Article

like

5 Likes

For uninterrupted reading, download the app