mirror of
https://github.com/sune-org/us.proxy.sune.chat.git
synced 2026-03-16 18:11:01 +00:00
Feat: Ntfy notification helper
This commit is contained in:
14
notify.js
Normal file
14
notify.js
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user