Skip to content

fix(hubspot): align getToken + getEntityDetails with current core contract#94

Merged
d-klotz merged 1 commit into
nextfrom
claude/hubspot-auth-contract-fix
Jun 9, 2026
Merged

fix(hubspot): align getToken + getEntityDetails with current core contract#94
d-klotz merged 1 commit into
nextfrom
claude/hubspot-auth-contract-fix

Conversation

@d-klotz

@d-klotz d-klotz commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What

Two fixes to packages/v1-ready/hubspot/definition.js so the module's auth contract matches the current @friggframework/core:

  • getToken — read the OAuth code from params.code. Current core's process-authorization-callback calls getToken(api, params) and itself reads params.code; the module was reading params.data.code, which is undefined.
  • getEntityDetails — return the user identifier instead of userId. Core's findOrCreateEntity spreads the returned identifiers straight into the repository's createEntity, which keys the entity by user. The lookup path normalizes user || userId, but the create path persists whatever key is passed. getCredentialDetails intentionally stays on userId (the credential contract).

Why

A downstream consumer (a Clockwork↔HubSpot integration) was working around both of these with a local requiredAuthMethods wrapper around hubspot.Definition. With this fix the wrapper is unnecessary.

🤖 Generated with Claude Code

Version

Published prerelease version: @friggframework/api-module-hubspot@2.0.0-next.7

Changelog

🐛 Bug Fix

  • @friggframework/api-module-hubspot
    • fix(hubspot): align getToken + getEntityDetails with current core contract #94 (@d-klotz)
  • @friggframework/api-module-microsoft-teams, @friggframework/api-module-slack, @friggframework/api-module-42matters, @friggframework/api-module-asana, @friggframework/api-module-attio, @friggframework/api-module-clio, @friggframework/api-module-connectwise, @friggframework/api-module-contentful, @friggframework/api-module-contentstack, @friggframework/api-module-crossbeam, @friggframework/api-module-deel, @friggframework/api-module-frigg-scale-test, @friggframework/api-module-frontify, @friggframework/api-module-google-calendar, @friggframework/api-module-google-drive, @friggframework/api-module-helpscout, @friggframework/api-module-hubspot, @friggframework/api-module-ironclad, @friggframework/api-module-linear, @friggframework/api-module-pipedrive, @friggframework/api-module-salesforce, @friggframework/api-module-stripe, @friggframework/api-module-unbabel-projects, @friggframework/api-module-unbabel, @friggframework/api-module-zoho-crm, @friggframework/api-module-zoom
    • fix(hubspot): listContacts omits null after so it can paginate past page 1 #93 (@d-klotz)

Authors: 1

…tract

getToken reads the OAuth code from params.code (current core passes it
unwrapped). getEntityDetails returns the `user` identifier instead of `userId`
so core's findOrCreateEntity create-path persists the right key — the lookup
path already normalizes user||userId, and getCredentialDetails keeps userId.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@d-klotz
d-klotz force-pushed the claude/hubspot-auth-contract-fix branch from fb26907 to 3742e0d Compare June 9, 2026 21:49
@d-klotz d-klotz added the release label Jun 9, 2026
@d-klotz
d-klotz merged commit 8d81d44 into next Jun 9, 2026
3 checks passed
@d-klotz
d-klotz deleted the claude/hubspot-auth-contract-fix branch June 9, 2026 21:51
requiredAuthMethods: {
getToken: async function (api, params) {
const code = get(params.data, 'code');
const code = get(params, 'code');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing backward compatibility fallback for params.data.code. The PR description promises a fallback for older cores but the code doesn't implement it. This will break integrations using older core versions that pass params.data.code.

Fix:

const code = get(params, 'code') || get(params.data, 'code');
Suggested change
const code = get(params, 'code');
const code = get(params, 'code') || get(params.data, 'code');

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@seanspeaks

Copy link
Copy Markdown
Contributor

🚀 PR was released in @friggframework/api-module-hubspot@2.0.0-next.7 🚀

@seanspeaks seanspeaks added the prerelease This change is available in a prerelease. label Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prerelease This change is available in a prerelease. release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants