TheDocumentation Index
Fetch the complete documentation index at: https://developers.hubspot.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
context object in the UI extensions SDK contains data related to the authenticated user and HubSpot account, along with data about where the extension was loaded.
Access context data
You can access context data using either approach:- Props-based approach: destructure
contextfrom the callback passed tohubspot.extend(), then pass it to your component as a prop. - Hook-based approach: call the
useExtensionContexthook directly within your component.
Fields
Thecontext object has the following fields.
Universal fields
| Field | Type | Description |
|---|---|---|
location | 'crm.record.tab' | 'crm.record.sidebar' | 'crm.preview' | 'helpdesk.sidebar' | 'settings' | 'home' | The UI extension’s location. |
portal.id | Number | The ID of the HubSpot account. |
portal.timezone | String | The account’s timezone. |
portal.dataHostingLocation | 'na1' | 'na2' | 'na3' | 'ap1' | 'eu1' | Geographic identifier that denotes the region where the current portal is hosted. See HubSpot Cloud Infrastructure FAQ for more details. |
user.id | Number | The user’s ID. |
user.email | String | The user’s primary email address. |
user.emails | Array | All of the user’s associated email addresses. |
user.firstName | String | The user’s first name. |
user.lastName | String | The user’s last name. |
user.locale | String | The user’s locale. |
user.language | String | The user’s UI display language, as selected in their HubSpot profile preferences. Represented as a BCP 47 language code (e.g., "en", "de", "fr"). Note that this differs from user.locale, which controls date and number formatting — language reflects the actual UI language the user has selected in HubSpot. Defaults to "en" if the user has not opted into a non-English UI language. |
user.teams | Array | An array containing information about teams that the user is assigned to. Each team object contains the id and name of the team, along with a teammates array that lists the IDs of other users on the team. |
user.permissions | Array | An array of permission strings (e.g., 'integrations-management-write'). |
variables | Object | All of the project’s config profile variables. |
CRM-specific fields
The following fields are only available in CRM extension points (crm.record.tab, crm.record.sidebar, crm.preview, helpdesk.sidebar):
| Field | Type | Description |
|---|---|---|
crm.objectId | Number | The ID of the CRM record (e.g., contact ID). |
crm.objectTypeId | String | The ID of the CRM record’s object type (e.g., 0-1). See the full list of object IDs for reference. |
extension.appId | Number | The extension’s app ID. |
extension.appName | String | The name of the extension’s app. |
extension.cardTitle | String | The extension’s title. |