Feat: Ntfy notification helper

This commit is contained in:
2026-02-18 13:16:48 -08:00
parent b30772d73a
commit 41b7db9c80

14
notify.js Normal file
View File

@@ -0,0 +1,14 @@
const NTFY_URL = process.env.NTFY_URL || ''
export function notify(msg, priority = 3, tags = []) {
if (!NTFY_URL) return
fetch(NTFY_URL, {
method: 'POST',
body: msg,
headers: {
Title: 'Sune Proxy',
Priority: `${priority}`,
Tags: tags.join(','),
},
}).catch(e => console.error('ntfy failed:', e))
}