Skip to main content

Documentation 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.

The 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 context from the callback passed to hubspot.extend(), then pass it to your component as a prop.
  • Hook-based approach: call the useExtensionContext hook directly within your component.

Fields

The context object has the following fields.

Universal fields

FieldTypeDescription
location'crm.record.tab' | 'crm.record.sidebar' | 'crm.preview' | 'helpdesk.sidebar' | 'settings' | 'home'The UI extension’s location.
portal.idNumberThe ID of the HubSpot account.
portal.timezoneStringThe 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.idNumberThe user’s ID.
user.emailStringThe user’s primary email address.
user.emailsArrayAll of the user’s associated email addresses.
user.firstNameStringThe user’s first name.
user.lastNameStringThe user’s last name.
user.localeStringThe user’s locale.
user.languageStringThe 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.teamsArrayAn 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.permissionsArrayAn array of permission strings (e.g., 'integrations-management-write').
variablesObjectAll 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):
FieldTypeDescription
crm.objectIdNumberThe ID of the CRM record (e.g., contact ID).
crm.objectTypeIdStringThe ID of the CRM record’s object type (e.g., 0-1). See the full list of object IDs for reference.
extension.appIdNumberThe extension’s app ID.
extension.appNameStringThe name of the extension’s app.
extension.cardTitleStringThe extension’s title.
Last modified on May 20, 2026