Add global presence heartbeat and online tracking

This commit is contained in:
2026-02-26 10:53:56 +01:00
parent 60442b4335
commit 5eeef54e46
6 changed files with 56 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
(function startPresenceHeartbeat() {
const ping = function () {
fetch("/api/presence/ping", {
method: "POST",
credentials: "same-origin",
keepalive: true,
headers: {
"Content-Type": "application/json",
},
body: "{}",
}).catch(function () {
// ignore network issues; next interval will retry
});
};
ping();
setInterval(ping, 15000);
})();