Project structure
- All project components must live within the
srcdirectory specified in the top-levelhsproject.jsonconfig file. - All app features and components must live within the
src/app/directory. Within thisapp/directory, you’ll define subdirectories for each feature you want your app to support:- App events are configured within
app-events/. - App objects are defined within
app-objects/. - All card features are defined within
cards/. - Settings page features are defined within
settings/. - Serverless functions are configured within
functions/. - Telemetry is configured within
telemetry/. - Webhook subscriptions are defined within
webhooks/. - Custom workflow actions are defined within
workflow-actions/.
- App events are configured within
- Within each feature subdirectory, you’ll configure the feature are using a
*-hsmeta.jsonfile. You can prefix the file name with something meaningful to your app (e.g.,my-app-hsmeta.json), as long as the file ends with-hsmeta.json. These files must live at the root level of their respective folder (e.g.,app/my-app-hsmeta.json,cards/my-card-hsmeta.json).
app-hsmeta.json file are provided in the app schema section below. Once you’re ready to add app features, check out the adding app features section.
*-hsmeta.json configuration files.
Specifying UIDs
Theuid field is an internally unique identifier for your specific app, and must also be globally unique within the project. Any app features will each have their own uid defined in their respective *-hsmeta.json files, which must be distinct from the top-level uid you choose in your app’s app-hsmeta.json file.
App schema
The top-level configuration for your app is specified within anapp-hsmeta.json configuration file in the app directory.
app-hsmeta.json.
Fields marked with * are required.
Distribution
Thedistribution field in your app schema allows you to configure how you want to distribute your app:
- If you plan to list your app on the HubSpot Marketplace, set the
distributionfield to"marketplace". An example app schema for this option can be found here. If you choose this option, ensure that you set thetypewithin theauthproperty tooauth, as detailed in the authentication section below. - If you want to allow your app to be installed in a specific set of allowlisted accounts, or if you want to restrict installation to a single account at a time, set
distributionto"private". Ensure that you set thetypewithin theauthproperty accordingly:- If you want to install your app in multiple accounts based on an allowlist you configure in your project settings, set the authentication
typetooauth. See the example app schema for this option here. - To restrict installation to a single account, either the same you use for development or another account that the installing user has access to, set the authentication
typetostatic. An example app schema for static auth can be found here.
- If you want to install your app in multiple accounts based on an allowlist you configure in your project settings, set the authentication
Authentication
Authentication for your app is configured via theauth property in your app schema. You can specify your app’s scope requirements, redirect URLs, and authentication type.
Fields marked with * are required.
Scopes
In theauth field of an app configuration file, you can specify three types of scopes: required scopes, conditionally required scopes, and optional scopes.
At a minimum, your app must include the read scope to enable customers to access the associated CRM object type (e.g., crm.objects.contacts.read to retrieve contacts).
Adding app features
To configure app features such as webhook subscriptions, custom workflow actions, and app cards, check out the guides below for details on how to add the associated*-hsmeta.json files to your project: