Loading...
Loading...
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.
npx skill4agent add hubspot/agent-cli-skills visitor-identificationconversationshubspot conversations visitor-identification --help| Requirement | Detail |
|---|---|
| Account tier | Professional or Enterprise |
| Required scope | |
| 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 |
# 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 Doe{"ok":true,"data":{"token":"eyJhbGciOiJIUzI1NiJ9..."}}{"ok":false,"error":{"status":403,"message":"Missing scope: conversations.visitor_identification.tokens.create"}}conversations.visitor_identification.tokens.createHUBSPOT_ACCESS_TOKENconversations.visitor_identification.tokens.createloadImmediately: falseconst { 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();HUBSPOT_ACCESS_TOKENidentificationEmail