Background

The app is not displayed in the UI. It runs continuously in the background to receive special events.

Example manifest

"location": {  "sell": {    "background": "assets/iframe.html"  }},

See Setting the app location.

Actions

In addition to objects available in all locations, the following action is available in this location:

registerSmartlistHandler

Registers a custom bulk action for one or more object types in a smart list. The bulk action toolbar displays the action under the Integrations dropdown. Clicking the action triggers a smartlistBatchAction event.

invoke
client.invoke("registerSmartlistHandler", {  name: "Bulk sync",  applicableTypes: ["Deal"],  eventName: "your.custom.event.name.v2",});
argument
  • name - Action name displayed in the toolbar

  • applicableTypes - Array of smart list object types. The action is only displayed for these types of smart lists. Allowed values are "Contact", "Deal", and "Lead". Defaults to ["Contact", "Deal", "Lead"]

  • eventName - smartlistBatchAction event triggered by clicking the action

Events

In addition to core events, the following event is available to apps in this location:

smartlistBatchAction

Fires when a user clicks a custom smart list action registered using the registerSmartlistHandler action. The event name is the action's eventName argument with a smartlistBatchAction. prefix.

Any event handler bound to the event receives the items array and entityType string.

client.on(  "smartlistBatchAction.your.custom.event.name.v2",  ({ items, entityType }) => {    console.log(items); // Array of selected smart list items    // Example of contacts or leads array:    // [    //   {    //     "email": "[email protected]",    //     "id": 1234567890,    //     "permissions": {    //       "delete": true,    //       "transfer": true,    //       "update": true    //     },    //     "phone_numbers": {    //       "mobile": "5555550001",    //       "phone": "5555550001"    //     },    //     "version": 1,    //     "website": "example.com"    //   },    //   {...}    // ]    //    // Example of deals array:    // [    //   {    //     "id": 1234567890,    //     "permissions": {    //       "delete": true,    //       "transfer": true,    //       "update": true    //     },    //     "version": 1    //   },    //   {...}    // ]    //    console.log(entityType); // Object type affected by the smart list action    // Must be one of "Contact", "Deal", or "Lead"  });