Skip to main content

Alerts

Allows you to define custom alerts that can be displayed in the dashboard.

Signature
interface DashboardAlertDefinition<TResponse = any> {    id: string;    title: string | ((data: TResponse) => string);    description?: string | ((data: TResponse) => string);    severity: AlertSeverity | ((data: TResponse) => AlertSeverity);    check: () => Promise<TResponse> | TResponse;    shouldShow: (data: TResponse) => boolean;    recheckInterval?: number;    actions?: Array<{        label: string;        onClick: (args: { data: TResponse; dismiss: () => void }) => void | Promise<any>;    }>;}

id

propertystring

A unique identifier for the alert.

title

propertystring | ((data: TResponse) => string)

The title of the alert. Can be a string or a function that returns a string based on the response data.

description

propertystring | ((data: TResponse) => string)

The description of the alert. Can be a string or a function that returns a string based on the response data.

severity

propertyAlertSeverity | ((data: TResponse) => AlertSeverity)

The severity level of the alert.

check

property() => Promise<TResponse> | TResponse

A function that checks the condition and returns the response data.

shouldShow

property(data: TResponse) => boolean

A function that determines whether the alert should be rendered based on the response data.

recheckInterval

propertynumber

The interval in milliseconds to recheck the condition.

actions

propertyArray<{ label: string; onClick: (args: { data: TResponse; dismiss: () => void }) => void | Promise<any>; }>

Optional actions that can be performed when the alert is shown.

The onClick() handler will receive the data returned by the check function, as well as a dismiss() function that can be used to immediately dismiss the current alert.

Was this chapter helpful?
Report Issue
Edited Feb 2, 2026·Edit this page