async function runSample(accessToken) {
  const drive = google.drive({
    version: 'v2',
    // this header will be present for every request
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  });

  // Make an authorized request to list Drive files.
  const res = await drive.files.list();
  console.log(res.data);

  return res;
}
/**
 * This example demonstrates authenticating to the Google APIs backend using
 * an access token only. Generally access tokens are obtained using the standard JWT
 * and 3-legged-OAuth methods, but from time to time only the access token
 * is available.
 */
This example demonstrates authenticating to the Google APIs backend using
an access token only. Generally access tokens are obtained using the standard JWT
and 3-legged-OAuth methods, but from time to time only the access token
is available.
This example demonstrates authenticating to the Google APIs backend using an access token only . Generally access tokens are obtained using the standard JWT and 3 - legged - OAuth methods but from time to time only the access token is available .
async function runSample(accessToken) {
  const drive = google.drive({
    version: 'v2',
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  });
  const res = await drive.files.list();
  console.log(res.data);
  return res;
}
async function runSample ( accessToken ) { const drive = google . drive ( { version : 'v2' , headers : { Authorization : ` ${ accessToken } ` , } , } ) ; const res = await drive . files . list ( ) ; console . log ( res . data ) ; return res ; }
This example demonstrates authenticating to the Google APIs backend using
 an access token only.
This example demonstrates authenticating to the Google APIs backend using an access token only .
// this header will be present for every request // Make an authorized request to list Drive files.