- Added functionality for subscribing to push notifications in Settings.vue. - Integrated service worker registration and notification permission requests. - Enhanced Vite configuration for PWA with manifest and caching strategies. - Created a script for generating PDF reports. - Added project report markdown file detailing the PWA implementation and features.
22 lines
792 B
JavaScript
22 lines
792 B
JavaScript
/**
|
|
* Script to generate VAPID keys for Web Push Notifications
|
|
* Run with: bun run generate-vapid-keys.js
|
|
*/
|
|
const webpush = require('web-push');
|
|
|
|
// Generate VAPID keys (public/private key pair)
|
|
const vapidKeys = webpush.generateVAPIDKeys();
|
|
|
|
console.log('VAPID Keys generated successfully:');
|
|
console.log('===============================');
|
|
console.log('Public Key:');
|
|
console.log(vapidKeys.publicKey);
|
|
console.log('===============================');
|
|
console.log('Private Key:');
|
|
console.log(vapidKeys.privateKey);
|
|
console.log('===============================');
|
|
console.log('Add these to your .env file as:');
|
|
console.log('VAPID_PUBLIC_KEY="' + vapidKeys.publicKey + '"');
|
|
console.log('VAPID_PRIVATE_KEY="' + vapidKeys.privateKey + '"');
|
|
console.log('===============================');
|