Better (send)Beacon
A better version of navigator.sendBeacon
, that doesn't break when you try to queue too many events!1
Installation:
bun add better-beacon
Usage:
import BetterBeacon from "better-beacon";
let bbeacon = new BetterBeacon({
autoTransformJSON: true,
});
bbeacon.send("/path", "true");
bbeacon.send("/path", { data: true });
Context:
You might be wondering, why does this library exist? Well fortunately for you, I wrote up a short blog post about it available here: [Building Better Beacon](https://matthamlin.me/2024/january/building-better-beacon)
Contributing:
build
bun run build
test
bun test
Tools: