Transports
Web Push
Encrypt and send browser notifications with VAPID.
Encrypt and send browser notifications with VAPID.
The one rule
Create this transport under the matching sently channel sender.
Configuration
| Option | Type | Default or requirement |
|---|---|---|
vapidPublicKey | string | required |
vapidPrivateKey | string | required |
subject | string | required |
allowedEndpointHosts | string[] | optional |
import { createPushSender } from "sently/push";
import { WebPushTransport } from "sently/transports/webpush";
const sender = createPushSender({ transport: new WebPushTransport({ vapidPublicKey: "...", vapidPrivateKey: "...", subject: "mailto:you@example.com" }) });await sender.send({ subscription, title: "Hello", body: "World" });No. Use the sently sender; provider-specific extras stay on the transport instance.