Getting Started with OAuth in HubSpot

Learn how to set up OAuth in HubSpot with this straightforward guide. We’ll walk you through creating a developer account, setting up your app, and using HubSpot’s Node.js OAuth starter to get up and running quickly.

Getting Started with OAuth in HubSpot
Do not index
Do not index
HubSpot is a thriving ecosystem, with a partner network valued at over $12.5 billion. If you’re looking to build for this ecosystem, you’ll need to learn OAuth with Hubspot. This short tutorial will guide you through the process using HubSpot’s OAuth starter for Node.js.

1. Create a Developer Account

First, you'll want to create a developer account. This gives you the access and credentials needed to start building. Once your account is set up, we can move on to creating a public app.

2. Create Your App and Add Basic Info

After setting up your account, you'll likely be redirected to create a new app. Go to the "Basic Info" tab and fill out the necessary details, like the app name. To keep things simple, I named mine "HubCards."
notion image

3. Set Up OAuth with Node.js Quickstart

HubSpot provides a Node.js quickstart to set up OAuth easily. We'll use this to create a new server and configure the backend. Start by cloning the repository in your IDE:
git clone git@github.com:HubSpot/oauth-quickstart-nodejs.git
Next, create an .env file in the root of the repository:
touch .env
Then, replace the .env content with your CLIENT_ID, CLIENT_SECRET, and required scopes:
CLIENT_ID='xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
CLIENT_SECRET='yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy'
SCOPE='crm.objects.contacts.read,forms'
You can find these values in the "Auth" tab of the "Basic Info" section.
notion image
Add the redirect URL and the required scopes (contacts and forms).
notion image

4. Set Up a Developer Test Account

Since apps can't be installed on developer accounts, you'll need to create a test account to run and install the app.
notion image
 

5. Test your OAuth

Finally, from the root of the repository, run:
yarn install
yarn start
And that's it! The OAuth setup should be working now.
 
 

Have you set up a HubSpot OAuth app before? I'd love to hear about your experience—feel free to drop me a note!

We build third-party apps and integrations

Partner with us →

Written by

Lola
Lola

Lola is the founder of Lunch Pail Labs. She enjoys discussing product, SaaS integrations, and running a business. Feel free to connect with her on Twitter or LinkedIn.