Repository navigation
Conversation
The HubSpot chat widget shows every logged-in user as "Unknown Visitor", so tickets created from chat have no contact or company. HubSpot's Visitor Identification API fixes that, but the token must be created server-side. GET /api/v1/auth/users/me/hubspot-chat-token/ returns a token for the requesting user. It returns 404 when HUBSPOT_ACCESS_TOKEN is not set and 502 when HubSpot fails, and it is throttled per user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8813 +/- ##
=======================================
Coverage 98.88% 98.88%
=======================================
Files 1683 1683
Lines 70275 70363 +88
=======================================
+ Hits 69489 69577 +88
Misses 786 786 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
question: Could the response include the email the token was minted for, |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature. (Not required: internal support widget.)Changes
HubSpot chat in the dashboard shows every logged-in user as "Unknown Visitor". The widget doesn't know who is chatting, so tickets created from chat have no contact or company. HubSpot's Visitor Identification API fixes this. The token has to be created server-side with our HubSpot access token, so this adds an endpoint the dashboard can call. This replaces what
pylon_email_signaturedid for Pylon chat.GET /api/v1/auth/users/me/hubspot-chat-token/returns{"token": "..."}for the requesting user (email, first name, last name). HubSpot tokens are valid for 12 hours.HUBSPOT_ACCESS_TOKENisn't set (self-hosted), and 502 when HubSpot fails. The dashboard loads the chat anonymously in both cases.hubspot_chat_tokenscope), because it shares the HubSpot token's rate limit with lead tracking.Before this works in production: the HubSpot private app behind
HUBSPOT_ACCESS_TOKENneeds theconversations.visitor_identification.tokens.createscope. HubSpot also only allows this API on a Professional or Enterprise subscription; otherwise every call gets the 502 path.The dashboard side is #8814. It falls back to anonymous chat while this endpoint isn't deployed.
Review effort: 2/5
How did you test this code?
🤖 Generated with Claude Code