Created
April 24, 2023 15:26
-
-
Save Wildanzr/bcb9782754183aff3f14b16aad9d5ece to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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