Skip to main content

Type Alias: PushPayload

PushPayload = object

Defined in: serviceWorker/createServiceWorker.ts:7

JSON payload a server sends through Web Push. Every field is optional; the service worker fills the gaps from its config.

Properties​

badge?​

optional badge?: string

Defined in: serviceWorker/createServiceWorker.ts:11


body?​

optional body?: string

Defined in: serviceWorker/createServiceWorker.ts:9


data?​

optional data?: Record<string, unknown>

Defined in: serviceWorker/createServiceWorker.ts:20

Any extra data the app wants back on click, kept in notification.data.


icon?​

optional icon?: string

Defined in: serviceWorker/createServiceWorker.ts:10


title?​

optional title?: string

Defined in: serviceWorker/createServiceWorker.ts:8


url?​

optional url?: string

Defined in: serviceWorker/createServiceWorker.ts:15

Same-origin URL opened when the notification is clicked.