Esta página aún no está disponible en Español, así que estás leyendo la versión en inglés.

web-push (Node.js)

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

★ Elegido por PWA.live: por aquí empezaríamos.

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.