> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# useDashboardAlerts()

- Package: [@gooddata/sdk-ui-dashboard](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.64/libs/sdk-ui-dashboard/src/model/react/useDashboardAlerting/useDashboardAlerts.tsx

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Hook that handles alert dialogs.

**Signature:**

```typescript
useDashboardAlerts: () => {
    alertToEdit: import("@gooddata/sdk-model").IAutomationMetadataObject | undefined;
    isInitialized: boolean;
    notificationChannels: import("@gooddata/sdk-model").INotificationChannelIdentifier[] | import("@gooddata/sdk-model").INotificationChannelMetadataObject[];
    automations: import("@gooddata/sdk-model").IAutomationMetadataObject[];
    automationsCount: number;
    numberOfAvailableDestinations: number;
    widget: import("../../types/layoutTypes.js").ICustomWidget | import("@gooddata/sdk-model").IWidget | undefined;
    insight: import("@gooddata/sdk-model").IInsight | undefined;
    automationsLoading: boolean;
    automationsError: import("@gooddata/sdk-ui").GoodDataSdkError | undefined;
    isAlertingVisible: boolean;
    isAlertDialogOpen: boolean;
    defaultOnAlerting: (widget?: import("@gooddata/sdk-model").IWidget) => void;
    onAlertingOpen: (widget?: import("@gooddata/sdk-model").IWidget, alert?: import("@gooddata/sdk-model").IAutomationMetadataObject) => void;
    onAlertingCancel: () => void;
    onAlertingCreateError: () => void;
    onAlertingCreateSuccess: (alert: import("@gooddata/sdk-model").IAutomationMetadataObject) => void;
    onAlertingUpdateError: () => void;
    onAlertingUpdateSuccess: () => void;
    isAlertManagementVisible: boolean;
    isAlertManagementDialogOpen: boolean;
    defaultOnAlertingManagement: (widget?: import("@gooddata/sdk-model").IWidget) => void;
    onAlertingManagementOpen: (widget?: import("@gooddata/sdk-model").IWidget) => void;
    onAlertingManagementClose: () => void;
    onAlertingManagementAdd: (targetWidget?: import("@gooddata/sdk-model").IWidget) => void;
    onAlertingDeleteError: () => void;
    onAlertingDeleteSuccess: () => void;
    onAlertingManagementEdit: (alert: import("@gooddata/sdk-model").IAutomationMetadataObject, widget?: import("@gooddata/sdk-model").IWidget) => void;
    onAlertingManagementLoadingError: () => void;
}
```
**Returns:**

{ alertToEdit: import("@gooddata/sdk-model").[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md) &#124; undefined; isInitialized: boolean; notificationChannels: import("@gooddata/sdk-model").[INotificationChannelIdentifier](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.inotificationchannelidentifier/index.md)[] &#124; import("@gooddata/sdk-model").[INotificationChannelMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.inotificationchannelmetadataobject/index.md)[]; automations: import("@gooddata/sdk-model").[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md)[]; automationsCount: number; numberOfAvailableDestinations: number; widget: import("../../types/layoutTypes.js").[ICustomWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-dashboard/sdk-ui-dashboard.icustomwidget/index.md) &#124; import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md) &#124; undefined; insight: import("@gooddata/sdk-model").[IInsight](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iinsight/index.md) &#124; undefined; automationsLoading: boolean; automationsError: import("@gooddata/sdk-ui").[GoodDataSdkError](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui/sdk-ui.gooddatasdkerror/index.md) &#124; undefined; isAlertingVisible: boolean; isAlertDialogOpen: boolean; defaultOnAlerting: (widget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md)) =&gt; void; onAlertingOpen: (widget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md), alert?: import("@gooddata/sdk-model").[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md)) =&gt; void; onAlertingCancel: () =&gt; void; onAlertingCreateError: () =&gt; void; onAlertingCreateSuccess: (alert: import("@gooddata/sdk-model").[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md)) =&gt; void; onAlertingUpdateError: () =&gt; void; onAlertingUpdateSuccess: () =&gt; void; isAlertManagementVisible: boolean; isAlertManagementDialogOpen: boolean; defaultOnAlertingManagement: (widget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md)) =&gt; void; onAlertingManagementOpen: (widget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md)) =&gt; void; onAlertingManagementClose: () =&gt; void; onAlertingManagementAdd: (targetWidget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md)) =&gt; void; onAlertingDeleteError: () =&gt; void; onAlertingDeleteSuccess: () =&gt; void; onAlertingManagementEdit: (alert: import("@gooddata/sdk-model").[IAutomationMetadataObject](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iautomationmetadataobject/index.md), widget?: import("@gooddata/sdk-model").[IWidget](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iwidget/index.md)) =&gt; void; onAlertingManagementLoadingError: () =&gt; void; }
