visitor-identification
Skill28 starsChanged 43 days agoApache-2.0View on GitHub
Generate a HubSpot Conversations visitor identification token for a known website visitor by email, with guidance on required scopes, account tier requirements, and how the frontend must use the token with the HubSpot Conversations SDK.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- getcargohq/gtm-skillstheir own version, first seen Oct 18, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- getcargohq/gtm-skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- audience-targetingSkill
- bulk-operationsSkill
- communication-historySkill
- conversation-history-briefSkill
- conversation-inbox-triageSkill
- crm-data-qualitySkill
- crm-lookupSkill
- customer-retentionSkill
- custom-object-managementSkill
- data-enrichmentSkill
- deal-managementSkill
- quote-to-cashSkill
- sales-executionSkill
- sales-reportingSkill
- team-ownershipSkill
- ticket-resolutionSkill
- workflow-automationSkill
- workSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 52
If the private app token is missing the required scope the CLI returns a 403 with a scope hint:
- Very specific: line 67
After generating the token server-side, set loadImmediately: false before the widget loads.
- Very specific: line 83
Do not expose your HUBSPOT_ACCESS_TOKEN (private app token) to the frontend.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Requires the conversations command group from hub-cli PR #251. hubspot conversations visitor-identification --help is authoritative.
What visitor identification is
When a known contact (someone whose email you have) visits your website, the HubSpot Conversations chat widget can identify them — linking the live chat session to their CRM record. To do this, your server generates a short-lived signed token and passes it to the HubSpot Conversations JavaScript SDK. The SDK sends the token to HubSpot, which verifies it and associates the chat session with the contact.
The token is NOT a general authentication credential. It identifies one visitor for one chat session and is useless outside the Conversations SDK.
Requirements
| Requirement | Detail |
| Account tier | Professional or Enterprise |
| Required scope | conversations.visitor_identification.tokens.create |
| Token lifetime | 12 hours; cache across page loads and refresh at least every 12 hours |
| Generation side | Server-side only — never generate in browser JavaScript; your private app token must remain secret |
Generate a token
# Minimal — email only
hubspot conversations visitor-identification create-token \
--email visitor@example.com
# With name (populates the contact preview in the widget)
hubspot conversations visitor-identification create-token \
--email visitor@example.com \
--first-name Jane \
--last-name DoeOutput:
{"ok":true,"data":{"token":"eyJhbGciOiJIUzI1NiJ9..."}}If the private app token is missing the required scope the CLI returns a 403 with a scope hint:
{"ok":false,"error":{"status":403,"message":"Missing scope: conversations.visitor_identification.tokens.create"}}Setting up the private app token
The conversations.visitor_identification.tokens.create scope must be granted on the HubSpot private app whose token is in HUBSPOT_ACCESS_TOKEN. To add the scope:
- In HubSpot: Settings → Integrations → Private Apps → [your app] → Scopes
- Under "CRM", enable
conversations.visitor_identification.tokens.create - Rotate the token if required after scope change
What the frontend must do with the token
After generating the token server-side, set loadImmediately: false before the widget loads. Then set the identification properties and load the widget:
const { token } = await fetch('/api/hs-visitor-token').then(r => r.json());
window.hsConversationsSettings = {
loadImmediately: false,
identificationEmail: 'visitor@example.com',
identificationToken: token,
};
window.HubSpotConversations.widget.load();Key rules:
- Generate the token server-side for authenticated users; cache it across page loads only if it is refreshed at least every 12 hours.
- Do not expose your
HUBSPOT_ACCESS_TOKEN(private app token) to the frontend. identificationEmailmust match the email used to generate the token.
See HubSpot's public documentation for the full Conversations SDK reference.
Known constraints
- Requires Professional or Enterprise HubSpot subscription. On Starter or Free the API returns a 403.
- One token per email address per call. Bulk generation is not supported.
- The token payload is opaque — do not attempt to decode or store it beyond passing it to the SDK.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

