WebpushNotification interface

Represents the WebPush-specific notification options that can be included in WebpushConfig. This supports most of the standard options as defined in the Web Notification specification.

Signature:

exportinterfaceWebpushNotification

Properties

PropertyTypeDescription
actionsArray<{ action: string; icon?: string; title: string; }>An array of notification actions representing the actions available to the user when the notification is presented.
badgestringURL of the image used to represent the notification when there is not enough space to display the notification itself.
bodystringBody text of the notification.
dataanyArbitrary data that you want associated with the notification. This can be of any data type.
dir'auto' | 'ltr' | 'rtl'The direction in which to display the notification. Must be one of auto, ltr or rtl.
iconstringURL to the notification icon.
imagestringURL of an image to be displayed in the notification.
langstringThe notification's language as a BCP 47 language tag.
renotifybooleanA boolean specifying whether the user should be notified after a new notification replaces an old one. Defaults to false.
requireInteractionbooleanIndicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. Defaults to false.
silentbooleanA boolean specifying whether the notification should be silent. Defaults to false.
tagstringAn identifying tag for the notification.
timestampnumberTimestamp of the notification. Refer to https://developer.mozilla.org/en-US/docs/Web/API/notification/timestamp for details.
titlestringTitle text of the notification.
vibratenumber | number[]A vibration pattern for the device's vibration hardware to emit when the notification fires.

WebpushNotification.actions

An array of notification actions representing the actions available to the user when the notification is presented.

Signature:

actions?:Array<{action:string;icon?:string;title:string;}>;

WebpushNotification.badge

URL of the image used to represent the notification when there is not enough space to display the notification itself.

Signature:

badge?:string;

WebpushNotification.body

Body text of the notification.

Signature:

body?:string;

WebpushNotification.data

Arbitrary data that you want associated with the notification. This can be of any data type.

Signature:

data?:any;

WebpushNotification.dir

The direction in which to display the notification. Must be one of auto, ltr or rtl.

Signature:

dir?:'auto'|'ltr'|'rtl';

WebpushNotification.icon

URL to the notification icon.

Signature:

icon?:string;

WebpushNotification.image

URL of an image to be displayed in the notification.

Signature:

image?:string;

WebpushNotification.lang

The notification's language as a BCP 47 language tag.

Signature:

lang?:string;

WebpushNotification.renotify

A boolean specifying whether the user should be notified after a new notification replaces an old one. Defaults to false.

Signature:

renotify?:boolean;

WebpushNotification.requireInteraction

Indicates that a notification should remain active until the user clicks or dismisses it, rather than closing automatically. Defaults to false.

Signature:

requireInteraction?:boolean;

WebpushNotification.silent

A boolean specifying whether the notification should be silent. Defaults to false.

Signature:

silent?:boolean;

WebpushNotification.tag

An identifying tag for the notification.

Signature:

tag?:string;

WebpushNotification.timestamp

Timestamp of the notification. Refer to https://developer.mozilla.org/en-US/docs/Web/API/notification/timestamp for details.

Signature:

timestamp?:number;

WebpushNotification.title

Title text of the notification.

Signature:

title?:string;

WebpushNotification.vibrate

A vibration pattern for the device's vibration hardware to emit when the notification fires.

Signature:

vibrate?:number|number[];