title: client_id and scope must both be provided to initialize OAuth
body: <p>I'm working off <a href="https://developers.google.com/sheets/api/quickstart/js" rel="nofollow noreferrer">Google Sheets API Javascript Quickstart</a> and have run into an authentication issue with <code>gapi.client.init()</code>.</p>
  
  <p>Here is the code that's giving me issues:</p>
  
  <pre><code>// Client ID and API key from the Developer Console
  var CLIENT_ID = "50m3-cle3nt-1d.apps.googleusercontent.com";
  var API_KEY = "AIzaN0tRe4lLyAn4pIk5y";
  
  // Array of API discovery doc URLs for APIs used by the quickstart
  var DISCOVERY_DOCS = ["https://sheets.googleapis.com/$discovery/rest?version=v4"];
  
  // Authorization scopes required by the API; multiple scopes can be
  // included, separated by spaces.
  var SCOPES = "https://www.googleapis.com/auth/spreadsheets.readonly";
  
  function initClient() {
      gapi.client.init({
          apiKey: API_KEY,
          discoveryDocs: DISCOVERY_DOCS,
          clientId: CLIENT_ID,
          scope: SCOPES
      }).then(function() {
          // doesn't matter.
      })
  }           
  </code></pre>
  
  <p>I can't get the <code>init()</code> call to work, and I get the error as in the question title even if I try to call <code>init()</code> on its own inside the console:</p>
  
  <pre><code>&gt; k = gapi.client.init({ ... })
  client_id and scope must both be provided to initialize OAuth
  </code></pre>
  
  <p>What am I missing in the call to <code>init()</code>?</p>
  
  <p>Any tips would be appreciated.</p>