Skip to content

illourr/better-beacon

 
 

Repository files navigation

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,
});

// Works just like `navigator.sendBeacon`!
bbeacon.send("/path", "true");

// Automatically converts objects to Blobs under the hood
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: [TODO](https://matthamlin.me/)

Contributing:

build

bun run build

test

bun test

Tools:

  • Typescript
  • SWC
  • Bun

About

Coming soon!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.7%
  • JavaScript 3.3%