const webpush = require('web-push');
// Generate some keys
webpush
.generateVAPIDKeys();
// Encrypt a payload
webpush
.encrypt(userPublicKey, userAuth, payload, contentEncoding);
// Set config
webpush
.setGCMAPIKey(apiKey);
// Generate headers
webpush
.getVapidHeaders(audience, subject, publicKey, privateKey, contentEncoding, expiration);
// Generate Metadata
webpush
.generateRequestDetails(pushSubscription, payload, options);
// Send a notification
webpush
.sendNotification(pushSubscription, payload, options);
// Constants
webpush.supportedContentEncodings.AES_GCM
webpush.supportedContentEncodings.AES_128_GCM