← Integrations

HubSpot

Read and update a user's HubSpot CRM contacts, companies and deals.

  • CRM & Sales
  • OAuth 2.0
  • Works on Free plan
  • Bundled in Kirak
  • Maintained by Kirak
View on GitHub →

How to use it

This profile ships with Kirak. Add "integrations" to modules in kirak.json, then name the profile as below. There is nothing to download, and a copy in your project's integrations/ folder is an error.

Environment variables

VariableHolds
KIRAK_INTEGRATION_HUBSPOT_CLIENT_SECRETThe OAuth client secret from the vendor's console. Secret: keep it out of kirak.json and out of source control.
KIRAK_AUTH_ENCRYPTION_KEYSEncrypts stored tokens. Shared by every integration; the module refuses to start without it.

The names follow the integration's name in kirak.json (hubspot here). Name it something else, such as hubspot_sales, and the variables change to match.

Redirect URL

Register this as the redirect (callback) URL in the vendor's console, with your app's address in place of <your-app> (the base_url in kirak.json):

https://<your-app>/integrations/hubspot/callback

How to get your keys

  1. Sign in to your HubSpot developer account and create an app.
  2. On the app’s Auth settings, add https://<your-app>/integrations/hubspot/callback as a redirect URL.
  3. Add the scopes your app needs. At least: crm.objects.contacts.read (Read contacts)
  4. Copy the client ID and the client secret.
  5. Put the client ID in kirak.json as integrations.providers.hubspot.client_id, and the client secret in the environment as KIRAK_INTEGRATION_HUBSPOT_CLIENT_SECRET. Never put the secret in kirak.json.

The vendor's own guide · Instructions out of date? ·Suggest an edit

kirak.json

Scopes
{
  "integrations": {
    "providers": {
      "hubspot": {
        "type": "oauth2",
        "profile": "hubspot",
        "client_id": "your-client-id",
        "scope": [
          "crm.objects.contacts.read"
        ]
      }
    }
  }
}

Merged into the profile: scope replaces the profile's default scopes.

Good to know

  • Access tokens last 30 minutes; the refresh token does not expire unless the user removes the app.
  • Each refresh may return a new refresh token; store the latest one.
  • The account is not read at connect, so the id is empty and multiple_accounts must stay off.
  • Not verified against the vendor docs in this session: check the facts before release.
Ask about Kirak on