mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
7 lines
279 B
TypeScript
7 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));
|