Skip to content

Commit

Permalink
chore: hubspot oauth provider (obot-platform#1631)
Browse files Browse the repository at this point in the history
Co-authored-by: Ivy <[email protected]>
  • Loading branch information
drpebcak and ivyjeong13 authored Feb 4, 2025
1 parent c892bf4 commit 285d246
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/docs/10-enterprise.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
We offer an enterprise-grade version of the Obot Platform that adds support for the following:
- Additional **auth providers** such as Okta and Microsoft Entra
- Additional **model providers** such as OpenAI on Azure and Anthropic on Amazon Bedrock
- Additional **tools** such as Salesforce
- Additional **tools** such as Salesforce and HubSpot

You can use this version free for non-commercial and proof-of-concept purposes by reaching out to us on our [Discord](https://discord.gg/9sSf4UyAMC).
You can use this version free for non-commercial and proof-of-concept purposes by reaching out to us on our [Discord](https://discord.gg/9sSf4UyAMC).
2 changes: 2 additions & 0 deletions ui/admin/app/components/oauth-apps/OAuthAppTypeIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
FaAtlassian,
FaGithub,
FaGoogle,
FaHubspot,
FaLinkedin,
FaMicrosoft,
FaSalesforce,
Expand All @@ -20,6 +21,7 @@ const IconMap = {
[OAuthProvider.Slack]: FaSlack,
[OAuthProvider.Salesforce]: FaSalesforce,
[OAuthProvider.Google]: FaGoogle,
[OAuthProvider.HubSpot]: FaHubspot,
[OAuthProvider.Microsoft365]: FaMicrosoft,
[OAuthProvider.Notion]: NotionLogoIcon,
[OAuthProvider.Zoom]: BiLogoZoom,
Expand Down
2 changes: 2 additions & 0 deletions ui/admin/app/lib/model/oauthApps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
import { AtlassianOAuthApp } from "~/lib/model/oauthApps/providers/atlassian";
import { GitHubOAuthApp } from "~/lib/model/oauthApps/providers/github";
import { GoogleOAuthApp } from "~/lib/model/oauthApps/providers/google";
import { HubSpotOAuthApp } from "~/lib/model/oauthApps/providers/hubspot";
import { LinkedInOAuthApp } from "~/lib/model/oauthApps/providers/linkedin";
import { Microsoft365OAuthApp } from "~/lib/model/oauthApps/providers/microsoft365";
import { NotionOAuthApp } from "~/lib/model/oauthApps/providers/notion";
Expand All @@ -17,6 +18,7 @@ export const OAuthAppSpecMap = {
[OAuthProvider.Atlassian]: AtlassianOAuthApp,
[OAuthProvider.GitHub]: GitHubOAuthApp,
[OAuthProvider.Google]: GoogleOAuthApp,
[OAuthProvider.HubSpot]: HubSpotOAuthApp,
[OAuthProvider.Microsoft365]: Microsoft365OAuthApp,
[OAuthProvider.Slack]: SlackOAuthApp,
[OAuthProvider.Salesforce]: SalesforceOAuthApp,
Expand Down
1 change: 1 addition & 0 deletions ui/admin/app/lib/model/oauthApps/oauth-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const OAuthProvider = {
Atlassian: "atlassian",
GitHub: "github",
Google: "google",
HubSpot: "hubspot",
Microsoft365: "microsoft365",
Slack: "slack",
Salesforce: "salesforce",
Expand Down
85 changes: 85 additions & 0 deletions ui/admin/app/lib/model/oauthApps/providers/hubspot.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import { z } from "zod";

import {
OAuthAppSpec,
OAuthFormStep,
getOAuthLinks,
} from "~/lib/model/oauthApps/oauth-helpers";
import { assetUrl } from "~/lib/utils";

const schema = z.object({
appID: z.string().min(1, "App ID is required"),
clientID: z.string().min(1, "Client ID is required"),
clientSecret: z.string().min(1, "Client Secret is required"),
optionalScope: z.string().optional(),
});

const steps: OAuthFormStep<typeof schema.shape>[] = [
{
type: "markdown",
text:
"### Step 1: Create a HubSpot Developer Account\n" +
"- Go to step 2 if you already have a developer account.\n" +
"- Complete the process to register a developer account.'\n" +
"- https://app.hubspot.com/signup-hubspot/developers",
},
{
type: "markdown",
text:
"### Step 2: Create app\n" +
"- From inside the developer portal, select `Apps` from the left sidebar.\n" +
"- Next, select `Create app` from the top right.\n" +
"- Type in a name for your OAuth app. Optionally provide a logo and description.\n",
},
{
type: "copy",
text: getOAuthLinks("hubspot").redirectURL,
},
{
type: "markdown",
text:
"### Step 3: Configure Auth Settings\n" +
"- Select the `Auth` tab.\n" +
"- Enter your Obot redirect URL into the `Redirect URLs` section.\n" +
"- Add scopes:\n" +
" - crm.lists.read\n" +
" - crm.lists.write\n" +
" - crm.objects.companies.read\n" +
" - crm.objects.companies.write\n" +
" - crm.objects.contacts.read\n" +
" - crm.objects.contacts.write\n" +
" - crm.objects.deals.read\n" +
" - crm.objects.deals.write\n" +
" - sales-email-read\n" +
" - tickets\n" +
"- Mark each scope as optional.\n" +
"- Click `Create app`",
},
{
type: "markdown",
text:
"### Step 4: Register your HubSpot App credentials with Obot\n" +
"- Select the `Auth` tab.\n" +
"- Enter the `App ID, Client ID, Client Secret` from this page into the fields below.\n" +
"- Also enter the scopes you enabled in the app creation process. Separate each scope with a space.",
},
{ type: "input", input: "appID", label: "App ID" },
{ type: "input", input: "clientID", label: "Client ID" },
{
type: "input",
input: "clientSecret",
label: "Client Secret",
inputType: "password",
},
{ type: "input", input: "optionalScope", label: "Optional Scope" },
];

export const HubSpotOAuthApp = {
schema,
alias: "hubspot",
type: "hubspot",
displayName: "HubSpot",
logo: assetUrl("/assets/hubspot_logo.svg"),
steps: steps,
noGatewayIntegration: true,
} satisfies OAuthAppSpec;
12 changes: 12 additions & 0 deletions ui/admin/public/assets/hubspot_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 285d246

Please sign in to comment.