@sophonz/instrumentation-user-interaction
v0.0.9
Published
Readme
@sophonz/instrumentation-user-interaction
Traces user interactions such as clicks, form submissions, and route changes, extending the OpenTelemetry user interaction instrumentation with element details and route change tracking.
Part of the Sophonz OpenTelemetry suite.
Install
bun add @sophonz/instrumentation-user-interaction
# or
pnpm add @sophonz/instrumentation-user-interaction
# or
npm install @sophonz/instrumentation-user-interactionUsage
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { SophonzUserInteractionInstrumentation } from '@sophonz/instrumentation-user-interaction';
registerInstrumentations({
instrumentations: [
new SophonzUserInteractionInstrumentation({
events: {
click: true,
dblclick: true,
submit: true,
change: true,
// ...other events
},
screenNameOption: 'full', // optional
}),
],
});API
| Export | Purpose |
|--------|---------|
| SophonzUserInteractionInstrumentation | Extends OpenTelemetry's UserInteractionInstrumentation with element details and route tracking. |
| SophonzUserInteractionInstrumentationConfig | Config with events map and screenNameOption. |
| DEFAULT_AUTO_INSTRUMENTED_EVENTS | Pre-configured event types: click, dblclick, mousedown, mouseup, submit, reset, change, dragend, drop, ended, pause, play. |
Peer dependencies
@opentelemetry/api^1.9.1@opentelemetry/instrumentation-user-interaction^0.61.0
License
See LICENSE in this package.
Part of sophonz-js.
