Skip to content

Commit

Permalink
chore(api): add script to generate vapid keys (#901)
Browse files Browse the repository at this point in the history
Co-authored-by: Johan Book <{ID}+{username}@users.noreply.github.com>
  • Loading branch information
johanbook and Johan Book authored Jul 20, 2024
1 parent f32dd7e commit b0a986c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions services/api/scripts/generate-vapid-keys
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
5 changes: 5 additions & 0 deletions services/api/src/cli/generate-vapid-keys.cli.ts
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}`);

0 comments on commit b0a986c

Please sign in to comment.