@sophonz/instrumentation-connectivity
v0.0.9
Published
Readme
@sophonz/instrumentation-connectivity
Monitors browser online and offline events to track connectivity state changes and offline duration.
Part of the Sophonz OpenTelemetry suite.
Install
bun add @sophonz/instrumentation-connectivity
# or
pnpm add @sophonz/instrumentation-connectivity
# or
npm install @sophonz/instrumentation-connectivityUsage
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { SophonzConnectivityInstrumentation } from '@sophonz/instrumentation-connectivity';
registerInstrumentations({
instrumentations: [
new SophonzConnectivityInstrumentation({
screenNameOption: 'full', // optional
}),
],
});The instrumentation auto-registers and listens to online and offline events on the window.
API
| Export | Purpose |
|--------|---------|
| SophonzConnectivityInstrumentation | Main instrumentation class. Tracks online and offline events. |
| SophonzConnectivityInstrumentationConfig | Config interface with optional screenNameOption. |
Peer dependencies
@opentelemetry/instrumentation^0.217.0
License
See LICENSE in this package.
Part of sophonz-js.
