Esta página ainda não está disponível em Português, por isso está a ler a versão em inglês.

web-push (Node.js)

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

★ Escolha do PWA.live: é por onde começarí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.