title: Unable to use Google Sheets API, can't generate correct credential elements
body: <p>I'm a big fan of Google Sheets API v4.  I did a project there four months ago, worked great.  No go now. Not sure what happened, but the credentials created via <a href="https://console.developers.google.com/apis/credentials?project=my-project-sheets-api" rel="nofollow noreferrer">https://console.developers.google.com/apis/credentials?project=my-project-sheets-api</a>  don't seem to have the same content as things I set up just four or five months ago.  </p>
  
  <p>5 month old project credentials:</p>
  
  <pre><code>{
      "installed": {
          "client_id": "4xxxxxxxxxx1-3xxxxxxxxxxg.apps.googleusercontent.com",
          "project_id": "previous-project",
          "auth_uri": "https://accounts.google.com/o/oauth2/auth",
          "token_uri": "https://www.googleapis.com/oauth2/v3/token",
          "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
          "client_secret": "wxxxxxt",
          "redirect_uris": [
              "urn:ietf:wg:oauth:2.0:oob",
              "http://localhost"
          ]
      }
  }
  </code></pre>
  
  <p>New project credentials:</p>
  
  <pre><code>{
    "type": "service_account",
    "project_id": "my-new-project-sheets-api",
    "private_key_id": "9xxxa",
    "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxQ=\n-----END PRIVATE KEY-----\n",
    "client_email": "my-new-project-sheets-api@my-new-project-sheets-api.iam.gserviceaccount.com",
    "client_id": "1xxx7",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/my-new-project-sheets-api%40my-new-project-sheets-api.iam.gserviceaccount.com"
  }
  </code></pre>
  
  <p>I don't use these consoles everyday.  In this case I used the "help me choose" wizard at <a href="https://console.cloud.google.com/apis/credentials?folder=&amp;organizationId=&amp;project=my-new-project-sheets-api" rel="nofollow noreferrer">https://console.cloud.google.com/apis/credentials?folder=&amp;organizationId=&amp;project=my-new-project-sheets-api</a></p>
  
  <p><a href="https://i.stack.imgur.com/HbkY5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HbkY5.png" alt="Google Cloud Console"></a></p>
  
  <p>From what I can see of the sheets API v4, is that I'm unable to generate token without a client_id, client_secret, redirect_uris[0] </p>
  
  <p>Using the wizard doesn't generate a client-secret, nor ever ask for redirect_uris .   How do I generate the correct set of credentials for a Google sheets read/write? Note: I'm only trying to read/write on a Google sheet that I've created, not other users' individual sheets.  And I'm only accessing the content on that Google sheet from a Node.js server, not from a client.    </p>
  
  <p>And as to the specific error that got me here, it's <code>TypeError: Cannot destructure property 'client_secret' of 'undefined' or 'null' at authorize()</code>; reference Quick start code shown at <a href="https://developers.google.com/sheets/api/quickstart/nodejs" rel="nofollow noreferrer">https://developers.google.com/sheets/api/quickstart/nodejs</a></p>
  
  <p><code>function authorize(credentials, callback) {
    const {client_secret, client_id, redirect_uris} = credentials.installed;</code></p>
  
  <p>How does one generate the correct credentials for Google Sheets API v4 ?</p>