web-push is a Node.js library for sending Web Push Protocol messages to browsers with automatic encryption and legacy support.
The Web Push Protocol requires backend servers to send push messages through a standardized mechanism, and any message payload must be encrypted according to the Message Encryption for Web Push specification. This library abstracts away the complexity of implementing these requirements, handling encryption automatically when a payload is provided and supporting legacy browser configurations that rely on GCM for message delivery.
The tool suits backend applications that need to send push notifications to subscribed browsers. It works with VAPID keys for authentication and can optionally use GCM API keys for legacy browser support. The library accepts push subscriptions in the standard browser format and allows optional payloads as strings or Node buffers. A command-line interface is available for generating VAPID key pairs and sending individual notifications without writing code, making it useful for testing and administrative tasks.
Development activity shows consistent maintenance with regular updates addressing compatibility and security concerns. The project accepts contributions and maintains documentation covering both programmatic and command-line usage patterns. The codebase remains actively managed to support evolving Web Push specifications and browser implementations.