feat(connect): HubSpot OAuth flow replaces manual token#3966
Conversation
|
@louis030195 Can I get a review on this one ? |
|
@Anshgrover23 is there a way to use MCP instead? in general we should use MCP oauth insted of oauth directly because it saves us hqving to click in the platform and setting up creds and stuff (less maintenance area) |
louis030195
left a comment
There was a problem hiding this comment.
crates/screenpipe-connect/src/connections/hubspot.rs:108 — hubspot list contacts api doesn't return total, only search does. always 0?
generated by the screenpipe pr-review pipe (https://screenpi.pe), not written by a human — reply and tag @louis030195 if it got something wrong.
GET /crm/v3/objects/contacts never returns `total` (only search does), so the previous test always showed "0 contacts". Switch to the account info endpoint which returns hubDomain/portalId for a real status message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@louis030195 HubSpot MCP OAuth isn't possible right now, their docs require manually creating an "MCP auth app" in the HubSpot dashboard before OAuth can work: This means no dynamic client registration, so we'd have to ship a client_secret in the binary. |
louis030195
left a comment
There was a problem hiding this comment.
crates/screenpipe-connect/src/connections/hubspot.rs:100 — portalId is an integer in hubspot api, .as_str() returns None. use .as_i64() or format
generated by the screenpipe pr-review pipe (https://screenpi.pe), not written by a human — reply and tag @louis030195 if it got something wrong.
- test(): use current account-info/v3/details endpoint (works with both OAuth tokens and Private App tokens); portalId is a JSON number so the previous as_str() always fell through to 'unknown portal' - list(): oauth integrations with credential fields stay 'connected' for users on manual fallback creds (HubSpot Private App tokens pre-OAuth, Teams webhook URLs) — proxy and test() already honor those creds, the tile must not flip off after upgrade - connections UI: render the fallback credential form behind an 'advanced' disclosure under the OAuth panel — without this the api_token field the PR keeps is unreachable (same for Teams webhook) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
update from the maintainer side: done:
remaining before merge:
@Anshgrover23 to confirm: a6527e57-7f73-4028-8c32-5648c3614ea7 is your own dev app's client id, right? checking nothing else depends on it before we swap. (written by louis's claude code session, reviewed by louis) |
|
@louis030195 Can we merge this one ? |
App created via HubSpot CLI developer project (app id 42350513). Redirect URI and the 10 scopes registered to match this config exactly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Description:
Fixes #3610
Replaces the HubSpot Private App token paste field with a one-click OAuth flow (contacts/companies/deals read+write), keeping
api_tokenas a silent fallback for enterprise users who can't use OAuth apps.Note for maintainer:
Before this goes live, two things need to happen server-side:
http://localhost:3030/connections/oauth/callbackas an allowed redirect URI in the HubSpot OAuth app at https://developers.hubspot.com/apps (app ID matching client_ida6527e57-7f73-4028-8c32-5648c3614ea7).HUBSPOT_CLIENT_SECRET=<secret>to the screenpi.pe proxy server env soPOST /api/oauth/exchangewithintegration_id: "hubspot"can complete the token exchange.