Implement proof of concept push notifications
This commit is contained in:
parent
e3210afe3a
commit
6007f4caeb
13 changed files with 407 additions and 1 deletions
10
generate-vapid-keys.mjs
Normal file
10
generate-vapid-keys.mjs
Normal file
|
@ -0,0 +1,10 @@
|
|||
import webPush from "web-push";
|
||||
import fs from "node:fs/promises";
|
||||
|
||||
const vapidKeys = webPush.generateVAPIDKeys();
|
||||
|
||||
const envData = `\
|
||||
VAPID_PUBLIC_KEY=${vapidKeys.publicKey}
|
||||
VAPID_PRIVATE_KEY=${vapidKeys.privateKey}
|
||||
`;
|
||||
await fs.writeFile(".env", envData, "utf-8");
|
Loading…
Add table
Add a link
Reference in a new issue