Skip to content

Instantly share code, notes, and snippets.

@Wildanzr
Created April 24, 2023 15:26
Show Gist options
  • Save Wildanzr/bcb9782754183aff3f14b16aad9d5ece to your computer and use it in GitHub Desktop.
Save Wildanzr/bcb9782754183aff3f14b16aad9d5ece to your computer and use it in GitHub Desktop.
// create OAuth2 client
const oauth2Client = new OAuth2(
OAUTH_CLIENT_ID,
OAUTH_CLIENT_SECRET,
'https://developers.google.com/oauthplayground'
);
// set refresh token
oauth2Client.setCredentials({
refresh_token: OAUTH_REFRESH_TOKEN
});
// get access token using promise
const accessToken = oauth2Client.getAccessToken()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment