title: How can I authenticate into Google Sheets API in Javascript without setting environment variables?
body: <p>I'm right now follow <a href="https://codingfundas.com/how-to-read-edit-google-sheets-using-node-js/index.html" rel="nofollow noreferrer">this</a> to write a script in Nodejs to write to Google sheets API. However, It turns out my system is not conducive to setting environment variables for this task. I have the credentials json, and I'd imagine I can just place its contents as a variable in my script, right? The two environment variables this tutorial says to set are</p>
  <pre><code>export GCLOUD_PROJECT={project ID of your google project}
  export GOOGLE_APPLICATION_CREDENTIALS=./service_account_credentials.json
  </code></pre>
  <p>How can I accomplish what this accomplishes, so my code authenticates WITHOUT setting/changing any env variables?</p>