@theshelf/notification-driver-webpush
v0.4.0
Published
This package contains the driver implementation for the [web push protocol](https://datatracker.ietf.org/doc/html/draft-ietf-webpush-protocol). This driver can be used by the [core package](../../core/README.md) for performing the actual operations.
Keywords
Readme
Notification web push driver | The Shelf
This package contains the driver implementation for the web push protocol. This driver can be used by the core package for performing the actual operations.
Installation
npm install @theshelf/notification @theshelf/notification-driver-webpushHow to use
The basic set up looks like this.
import NotificationService, { WebPushDriver } from '@theshelf/notification';
const driver = new WebPushDriver( /* Configuration */);
const notificationService = new NotificationService(driver);
// Perform operations with the notificationService instanceConfiguration
type WebPushConfiguration = { // Vapid details
subject: string;
publicKey: string;
privateKey: string;
};