Reference information for building app cards on the latest version of the developer platform.
cards
directory within app/
. The cards
directory should contain:
*-hsmeta.json
)..jsx
or .tsx
file.package.json
file to handle any needed dependencies.*-hsmeta.json
configuration file for your app card, include the properties below.
Fields marked with * are required.
Field | Type | Description |
---|---|---|
uid * | String | The card’s unique identifier. This can be any string, but should meaningfully identify the card. HubSpot will identify the card by this ID so that you can change the card’s title without removing historical or stateful data, such as the position on the CRM record. |
type | String | The type of component, which should be card in this case. |
config | Object | An object containing configuration details. |
name * | String | The card’s title, as displayed in HubSpot’s UI. |
description | String | A description of the card. |
previewImage | Object | An object containing the file and altText fields. The file field is the relative path to the preview image. Valid file extensions are png, jpeg, jpg, or gif. The maximum file size is 5.0 MB. The altText field is a short description of the image. |
entrypoint * | String | The file path of the card’s front-end React code. |
location * | crm.record.tab | crm.record.sidebar | crm.preview |helpdesk.sidebar | Where the card appears in HubSpot’s UI. You can only specify one location value, but some location and objectTypes combinations result in multiple location support. See the Supported locations section below for more details. |
objectTypes * | Array | The types of CRM records that the card will appear on. See the Supported objects section below for more details. |
objectTypes
array of the card’s *-hsmeta.json
configuration file, specify the types of CRM records that the card will appear on. Below are the currently supported CRM objects, their objectType
value, and the minimum scope to add to your app.
objectType
values are not case sensitive, and both the singular and plural are supported. For example, "CONTACT"
and "contacts"
are both valid.CRM object | objectType value | Related scope |
---|---|---|
Contacts | CONTACT | crm.objects.contacts.read |
Companies | COMPANY | crm.objects.companies.read |
Deals | DEALS | crm.objects.deals.read |
Tickets | TICKETS | tickets |
Custom objects | p_objectName (case sensitive) | crm.objects.custom.read |
App objects | app_object_uid | See app objects scopes |
CRM object | objectType value | Related scopes |
---|---|---|
Appointments | APPOINTMENTS | crm.objects.appointments.read |
Courses | COURSES | crm.objects.courses.read |
Listings | LISTINGS | crm.objects.listings.read |
Services | SERVICES | crm.objects.services.read |
location
field of the card’s *-hsmeta.json
configuration file, specify where the card should display in HubSpot. Below are the currently supported locations.
crm.record.tab
: places the extension in the middle column of CRM record pages, either in one of HubSpot’s default tabs or in a custom tab. When objectType
is set to COMPANIES
, the card will also be available in the sales workspace target accounts preview panel.crm.record.sidebar
: displays the extension in the right sidebar of CRM record pages. Extensions in the sidebar cannot use CRM data components. When objectType
is set to DEALS
, the card will also be available in the sales workspace deals sidebar.crm.preview
: displays the app card in the preview panel that you can access throughout the CRM. When using this location, the extension will be available when previewing the objectTypes
specified in the JSON config file. This includes previewing records from within CRM record pages, index pages, board views, and the lists tool. Learn more about customizing previews.helpdesk.sidebar
: displays the card in the ticket sidebars within help desk. This includes both the ticket preview panel on the help desk home page and the right sidebar of the ticket view in help desk. To add a card to this location, you’ll need to configure your help desk settings to include the card.tickets
in the scopes
array, and that the card’s JSON configuration file includes tickets
in the objectTypes
field..jsx
or .tsx
. This file lives in the cards/
directory alongside the the card configuration JSON file (*-hsmeta.json
). In the card configuration file, you’ll specify the path of the React file in the entrypoint
field.
Below is an example of a simple app card, which includes Text
and Button
UI components to render the card content, along with a Flex
component for managing layout.
package.json
file within the cards/
directory. By default, when adding an app card through the hs project add
command, a package.json
file will be created for you with the following dependencies:
@hubspot/ui-extensions
react
typescript
package.json
file, you can run the hs project install-deps
command in your project directory.