web-push (Node.js)

Sends Web Push messages from Node.js: VAPID signing, payload encryption and a CLI to generate VAPID keys.

★ A PWA.live pick: where we would start.

Sends Web Push messages from Node.js: VAPID signing, payload encryption and a CLI to generate VAPID keys.

When to use it

Your server runs Node.js.

Get started

npm i web-push
import webpush from 'web-push';
webpush.setVapidDetails('mailto:[email protected]', PUBLIC_KEY, PRIVATE_KEY);
await webpush.sendNotification(subscription, JSON.stringify({ title: 'Hello' }));

Source code, issues and documentation: github.com/web-push-libs/web-push.