Files
us.proxy.sune.chat/notify.js
T

16 lines
370 B
JavaScript

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: 'us.proxy.sune.chat',
Priority: `${priority}`,
Tags: tags.join(','),
Markdown: 'yes',
},
}).catch(e => console.error('ntfy failed:', e))
}