MDK Logo

Alert

Alert management and notification hooks

Hooks for managing alerts and notifications.

Package

@tetherto/mdk-react-adapter

Hooks

@tetherto/mdk-react-adapter

Import the public APIs on this page from @tetherto/mdk-react-adapter.

useCurrentAlertDevices

TanStack Query hook returning a flat list of the devices that currently carry one or more alerts, ready to hand straight to the devkit <Alerts> / <CurrentAlerts> table.

(options: UseCurrentAlertDevicesOptions = {}) => UseQueryResult<ListThingsDevice[], Error>

useHistoricalAlerts

TanStack Query hook for the historical-alerts log. Fetches the [start, end] range as successive 24-hour history-log windows (see fetchHistoricalAlertsInChunks), merges them by uuid, and shapes the rows for the devkit `<HistoricalAl…

({ start, end, intervalMs, enabled, }: UseHistoricalAlertsOptions) => UseQueryResult<HistoricalAlert[], Error>

On this page