Skip to content

Instantly share code, notes, and snippets.

@pcothenet
Created November 9, 2017 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcothenet/1d89409046e2ef8ea3b89c94c9f3f64f to your computer and use it in GitHub Desktop.
Save pcothenet/1d89409046e2ef8ea3b89c94c9f3f64f to your computer and use it in GitHub Desktop.
const params = {
clientId: hubspot_app.clientId,
clientSecret: hubspot_app.clientSecret,
redirectUri: `${hubspot_app.redirectUri}?state=${tenant}`,
refreshToken: refresh_token
}
const hubspot = new Hubspot(params)
if (refresh_token) {
return hubspot.refreshAccessToken()
.then(results => // save your new access token)
.then(() => hubspot)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment