diff --git a/services/api/scripts/generate-vapid-keys b/services/api/scripts/generate-vapid-keys new file mode 100755 index 00000000..ceb6f2dd --- /dev/null +++ b/services/api/scripts/generate-vapid-keys @@ -0,0 +1,6 @@ +#!/bin/bash + +# Exit immediately if a command exits with a non-zero status +set -e + +npx ts-node ./dist/cli/generate-vapid-keys.cli.js diff --git a/services/api/src/cli/generate-vapid-keys.cli.ts b/services/api/src/cli/generate-vapid-keys.cli.ts new file mode 100644 index 00000000..07f20c6a --- /dev/null +++ b/services/api/src/cli/generate-vapid-keys.cli.ts @@ -0,0 +1,5 @@ +import { generateVAPIDKeys } from "web-push"; + +const keys = generateVAPIDKeys(); +console.log(`VAPID_PRVIVATE_KEY=${keys.privateKey}`); +console.log(`VAPID_PUBLIC_KEY=${keys.publicKey}`);