Conversation
Why: For the [node hubspot api client], I would like to have an example to show how to obtain an auth token with the appropriate scopes for running the test suite with mocking disabled. [node hubspot api client]: https://github.com/MadKudu/node-hubspot This PR: Adds all the hubspot scopes as "Optional" meaning that they'll only be asked for access if those features are enabled.
There was a problem hiding this comment.
Hey @MattMSumner, thanks for making this PR!
I like the idea of adding optional scopes to this project to show how they're used, but I think it should be an empty array in the main repo (since it's only using the contacts scope). Maybe the Node client's example could reference a fork of this project that has Maybe the scopes/optional scopes be read in from an environment variable instead, with defaults set if nothing is suppliedOPTIONAL_SCOPES filled in instead?
| 'https://app.hubspot.com/oauth/authorize' + | ||
| `?client_id=${encodeURIComponent(CLIENT_ID)}` + // app's client ID | ||
| `&scope=${encodeURIComponent(SCOPES)}` + // scopes being requested by the app | ||
| `&optional_scope=${encodeURIComponent(OPTIONAL_SCOPES)}` + |
There was a problem hiding this comment.
This query parameter should only be added if there are optional scopes being requested
|
I love the idea of an ENV variable. I can take another look at this on Friday. |
|
Resolved by #4 - scopes can now be specified with a |
Why:
For the node hubspot api client, I would like to have an example to
show how to obtain an auth token with the appropriate scopes for running
the test suite with mocking disabled.
This PR:
Adds all the hubspot scopes as "Optional" meaning that they'll only be
asked for access if those features are enabled.