# Notification

**Kind**: interface | **Module**: [Notifications](https://docs.interop.io/desktop/reference/javascript/notifications/index.md)

**Source**: https://docs.interop.io/desktop/reference/javascript/notifications/notification/index.html

Describes a raised notification.

## Properties

- **`actions`** (`NotificationAction[]`, required)
  Array of objects describing the available notification actions.
- **`appIcon`** (`string`, optional)
  Icon of the app that has raised the notification.
- **`appTitle`** (`string`, optional)
  Title of the app that has raised the notification.
- **`badge`** (`string`, optional)
  URL of an image to represent the notification as a badge.
- **`body`** (`string`, optional)
  Notification body text.
- **`clickInterop`** (`InteropActionSettings`, optional)
  Settings for invoking an Interop method when the notification is clicked.
- **`close`** (`() => void`, required)
  Closes the notification.
- **`data`** (`any`, optional)
  Arbitrary data you have associated with the notification.
- **`dir`** (`"auto" | "ltr" | "rtl"`, optional) default: `"auto"`
  The direction in which to display the notification.
- **`icon`** (`string`, optional)
  URL of an icon to be displayed in the notification.
- **`id`** (`string`, required)
  ID for the notification.
- **`image`** (`string`, optional)
  URL of an image to be displayed in the notification.
- **`instanceId`** (`string`, required)
  ID of the app instance that has raised the notification.
- **`lang`** (`string`, optional)
  [Language code](https://www.sitepoint.com/iso-2-letter-language-codes/) of the notification.
- **`onaction`** (`(event: ActionEvent) => void`, required)
  Notifies when a notification action has been clicked.
- **`onclick`** (`(event: ClickEvent) => void`, required)
  Notifies when the notification has been clicked.
- **`onclose`** (`(() => void)`, required)
  Notifies when the notification is closed.
- **`onerror`** (`(event: ErrorEvent) => void`, required)
  Notifies when there is a notification error.
- **`onshow`** (`(event: ShowEvent) => void`, required)
  Notifies when the notification has been shown.
- **`panelExpiry`** (`number`, optional)
  Interval in seconds after which the notification will be removed from the Notification Panel.
- **`renotify`** (`boolean`, optional) default: `false`
  If `true`, will renotify the user if a new notification replaces an old one. In this case, `tag` must also be set.
- **`requireInteraction`** (`boolean`, optional) default: `false`
  If `true`, the notification will remain active and won't be closed until the user clicks on it or dismisses it.
- **`severity`** (`"Low" | "Medium" | "High" | "Critical" | "None"`, optional)
  Severity of the notification.
- **`silent`** (`boolean`, optional) default: `false`
  If `true`, the notification will be silent (no sound or vibration) despite the device settings. In this case, `vibrate` must not be set.
- **`source`** (`string`, optional)
  Can be used for overwriting the name of the actual notification source.
- **`state`** (`State`, optional)
  State of the raised notification.
- **`tag`** (`string`, optional)
  ID tag of the notification.
- **`timestamp`** (`number`, optional)
  Specifies the time at which the notification is created or is applicable (past, present or future).
- **`title`** (`string`, required)
  Title for the notification.
- **`toastExpiry`** (`number`, optional)
  Interval in seconds after which the notification toast will be hidden.
- **`type`** (`"Notification" | "Alert"`, optional)
  Type of the notification. `"Notification"` is usually a general non-urgent notification, while `"Alert"` is an urgent one.
- **`vibrate`** (`number[]`, optional)
  Vibration pattern for the vibration hardware of the device to emit with the notification. If specified, `silent` must not be `true`.

## Related types

- [ActionEvent](https://docs.interop.io/desktop/reference/javascript/notifications/actionevent/index.md)
- [ClickEvent](https://docs.interop.io/desktop/reference/javascript/notifications/clickevent/index.md)
- [ErrorEvent](https://docs.interop.io/desktop/reference/javascript/notifications/errorevent/index.md)
- [InteropActionSettings](https://docs.interop.io/desktop/reference/javascript/notifications/interopactionsettings/index.md)
- [NotificationAction](https://docs.interop.io/desktop/reference/javascript/notifications/notificationaction/index.md)
- [ShowEvent](https://docs.interop.io/desktop/reference/javascript/notifications/showevent/index.md)
- [State](https://docs.interop.io/desktop/reference/javascript/notifications/state/index.md)
