MDK Logo
ReferenceUIHooks

Alert Hooks

Alert management and notification hooks

Hooks for managing alerts and notifications.

Package

@tetherto/mdk-react-adapter

Hooks

useCurrentAlertDevices

TanStack Query hook returning the raw devices that currently carry one or more alerts, as the nested ListThingsDevice[][] the devkit <Alerts> / <CurrentAlerts> table expects (the table heads the outer array itself).

(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