mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-17 13:34:24 +01:00
8 lines
279 B
TypeScript
8 lines
279 B
TypeScript
import { generateVapidKeys } from '@negrel/webpush';
|
|
import { encodeBase64 } from '@std/encoding/base64';
|
|
|
|
const { privateKey } = await generateVapidKeys({ extractable: true });
|
|
const bytes = await crypto.subtle.exportKey('pkcs8', privateKey);
|
|
|
|
console.log(encodeBase64(bytes));
|