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

---
id: 7f8f7062-9fae-483e-ac86-7f958910a30a
---

# Context

> Reference information for the context object provided by the UI extensions SDK.

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`](/apps/developer-platform/add-features/ui-extensions/ui-extensions-sdk/hooks#useextensioncontext) hook directly within your component.

## Fields

The `context` 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](https://knowledge.hubspot.com/account-security/hubspot-cloud-infrastructure-and-data-hosting-frequently-asked-questions) 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](/developer-tooling/local-development/build-with-config-profiles) 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](/guides/crm/understanding-the-crm#object-type-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.                                                                                                                                    |
