-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(api): add script to generate vapid keys (#901)
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
- Loading branch information
Showing
2 changed files
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}`); |