Definition
actions (Notification option)
actions is an array option passed to showNotification(), e.g. { actions: [{ action: "reply", title: "Reply" }, { action: "dismiss", title: "Dismiss" }] }, that renders extra buttons on the notification itself. The service worker's notificationclick handler reads event.action to see which button, if any, the user pressed.
Handling looks like: self.addEventListener("notificationclick", (event) => { event.notification.close(); if (event.action === "reply") { /* open a reply UI */ } else { clients.openWindow("/inbox"); } });.
Actions are only usable from a service-worker-shown notification (self.registration.showNotification()) — the page-level new Notification() constructor does not support the actions option at all, per the spec.
Most platforms cap the number of visible actions at two, so any additional entries in the array are simply not rendered rather than causing an error; design the primary flow around the first two actions.
Each action can also specify its own small icon via an icon field, though rendering of action icons varies significantly by OS and is often omitted in practice for reliability.