We expect you to not need to bring your own app (BYOA), but the app_info parameter of hubspot_token_create() ensures you can do that if you want (for instance to define an app with only the scope needed for the endpoints you use as opposed to all the endpoints the hubspot package supports; or to be sure your requests do not end up in the logs of our default app but instead in an app your organization controls).

To BYOA,

my_very_own_app <- list(client_secret = <CLIENTSECRET>,
       client_id = <CLIENTID>,
       app_id = <APPID>,
       scope = c(<"scope1", "scope2", etc>))
hubspot_token_create(app_info = my_very_own_app)

To distribute your app across your projects or across team members, you could make it a function in an internal package, or use environment variables.

Token refreshing

If the token expires in less than 60 seconds, it'll be refreshed and cached thanks to the refresh token.



lockedata/hubspot documentation built on March 1, 2020, 8:54 p.m.