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,
Read and execute Hubspot's docs about how to create an app. You'll need to create a Hubspot developer account.
Define the app_info
list.
my_very_own_app <- list(client_secret = <CLIENTSECRET>, client_id = <CLIENTID>, app_id = <APPID>, scope = c(<"scope1", "scope2", etc>))
hubspot_token_create()
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.
If the token expires in less than 60 seconds, it'll be refreshed and cached thanks to the refresh token.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.