Skip to content

Instantly share code, notes, and snippets.

@ulexxander
Created May 15, 2022 09:55
Show Gist options
  • Save ulexxander/cec6b2405f323d06575263ef26a1731c to your computer and use it in GitHub Desktop.
Save ulexxander/cec6b2405f323d06575263ef26a1731c to your computer and use it in GitHub Desktop.
Google Auth getAccessToken using keyFile
const googleAuth = new GoogleAuth({
keyFile: "./google-service-account.json",
scopes: "https://www.googleapis.com/auth/homegraph",
});
const accessToken = await googleAuth.getAccessToken();
console.log(accessToken);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment