# bpmn-js-tracking

> An extension for [bpmn-js](https://github.com/bpmn-io/bpmn-js) to track user interaction.

Latest version **0.6.0** (published 2024-04-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install bpmn-js-tracking
pnpm add bpmn-js-tracking
yarn add bpmn-js-tracking
bun add bpmn-js-tracking
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2024-04-26 |
| First published | 2023-05-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Beatriz Mendes |
| Maintainers | vsgoulart, skaiir-camunda, marstamm, bpmn-io-admin, nikku, barmac, philippfromme, maxtru |

## Links

- npm: https://www.npmjs.com/package/bpmn-js-tracking
- Repository: https://github.com/bpmn-io/bpmn-js-tracking
- Homepage: https://github.com/bpmn-io/bpmn-js-tracking#readme
- Issues: https://github.com/bpmn-io/bpmn-js-tracking/issues
- npm.io page: https://npm.io/package/bpmn-js-tracking

## Recent versions

- 0.6.0 (latest) — 2024-04-26
- 0.5.0 — 2024-04-11
- 0.4.0 — 2024-01-22
- 0.3.3 — 2023-09-25
- 0.3.2 — 2023-07-06
- 0.3.1 — 2023-06-30
- 0.3.0 — 2023-05-25
- 0.2.0 — 2023-05-16
- 0.1.0 — 2023-05-02

## README

# bpmn-js-tracking

An extension for [bpmn-js](https://github.com/bpmn-io/bpmn-js) to track user interaction.


## Installation

Install via [npm](http://npmjs.com/).

```
npm install bpmn-js-tracking
```


## Usage

Add as additional module to [bpmn-js](https://github.com/bpmn-io/bpmn-js).

```javascript
import {
  BpmnJSTracking,
  BpmnJSTrackingModules
 } from 'bpmn-js-tracking';

const bpmnJS = new BpmnJS({
  additionalModules: [
    BpmnJSTracking,
    BpmnJSTrackingModules
  ]
})

const bpmnJsTracking = bpmnJS.get('bpmnJSTracking');

bpmnJsTracking.on('tracking.enabled', function(event) {
  // opt into tracking platform
});

bpmnJsTracking.on('tracking.event', function(event) {
  // send to tracking platform
  // event: { name, data }
});

bpmnJsTracking.on('tracking.disabled', function(event) {
  //  opt out of tracking platform
});
```

Alternatively, you can import specific tracking modules:

```javascript
import popupMenuTracking from 'bpmn-js-tracking/lib/features/popup-menu';
```

## Tracked events

### Context pad events

| Event Name | Structure |
| :--- | :--- |
| `contextPad.trigger`| <ul><li>entryId</li><li>entryGroup</li><li>entryTitle</li><li>selection</li><li>triggerType: ["click", "drag", "keyboard"]</li></ul>|

### Element templates events

| Event Name | Structure |
| :--- | :--- |
| `elementTemplates.select`| <ul><li>element</li></ul>|
| `elementTemplates.update`| <ul><li>element</li><li>newTemplate</li></ul>|
| `elementTemplates.remove`| <ul><li>element</li></ul>|
| `elementTemplates.unlink`| <ul><li>element</li></ul>|

### Modeling events

| Event Name | Structure |
| :--- | :--- |
| `modeling.appendElement`| <ul><li>element</li><li>sourceElement</li></ul>|
| `modeling.createElements`| <ul><li>elements</li></ul>|
| `modeling.replaceElement`| <ul><li>oldElement</li><li>newElement</li></ul>|

### Palette events

| Event Name | Structure |
| :--- | :--- |
| `palette.trigger`| <ul><li>entryId</li><li>entryGroup</li><li>entryTitle</li><li>selection</li><li>triggerType: ["click", "drag", "keyboard"]</li></ul>|
### Popup menu events

| Event Name | Structure |
| :--- | :--- |
| `popupMenu.open`| <ul><li>selection</li></ul>|
| `popupMenu.trigger`| <ul><li>entryId</li><li>entryGroup</li><li>entryLabel</li><li>triggerType: ["click", "drag", "keyboard"]</li></ul>|

### Selection events

| Event Name | Structure |
| :--- | :--- |
| `selection.select`| <ul><li>oldSelection</li><li>newSelection</li></ul>|

---
_Source: https://npm.io/package/bpmn-js-tracking · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
