@absolutejs/beacon 0.7.0-beta.15 → 0.7.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +52 -0
- package/changelog.json +13 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +2 -2
- package/dist/outbox.d.ts +42 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ This file is generated by `absolute-changelog` from the entries in
|
|
|
6
6
|
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
7
|
`changelog/unreleased/`.
|
|
8
8
|
|
|
9
|
+
## 0.7.0-beta.16 — 2026-10-24
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **A durable browser outbox (@absolutejs/beacon/outbox): bounded IndexedDB or memory storage, acknowledged delivery, retry backoff and pruning** (`BEACON_SDK_VERSION`)
|
|
14
|
+
|
|
9
15
|
## 0.7.0-beta.15 — 2026-09-30
|
|
10
16
|
|
|
11
17
|
### Added
|
package/README.md
CHANGED
|
@@ -346,3 +346,55 @@ the bundler merge the whole SDK back into it, defeating lazy startup.
|
|
|
346
346
|
|
|
347
347
|
BSL-1.1 with a named carveout against hosted error-tracking / session-replay
|
|
348
348
|
SaaS (Sentry, Datadog, LogRocket). See `LICENSE`.
|
|
349
|
+
|
|
350
|
+
## Durable outbox
|
|
351
|
+
|
|
352
|
+
`@absolutejs/beacon/outbox` exports `createOutbox`, `createIndexedDBOutboxStore`,
|
|
353
|
+
`createMemoryOutboxStore`, and the `OutboxStore`/`OutboxRecord` types. It is a
|
|
354
|
+
separate browser entry point: existing beacon collectors keep their current API.
|
|
355
|
+
The host supplies already-redacted payloads and owns scheduling and server storage.
|
|
356
|
+
|
|
357
|
+
```ts
|
|
358
|
+
import {
|
|
359
|
+
createOutbox,
|
|
360
|
+
createIndexedDBOutboxStore,
|
|
361
|
+
} from "@absolutejs/beacon/outbox";
|
|
362
|
+
const outbox = createOutbox({
|
|
363
|
+
store: createIndexedDBOutboxStore("my-app-telemetry"),
|
|
364
|
+
send: async (record, signal) => {
|
|
365
|
+
const response = await fetch("/diagnostics/batches", {
|
|
366
|
+
method: "POST",
|
|
367
|
+
signal,
|
|
368
|
+
headers: { "Content-Type": "application/json" },
|
|
369
|
+
body: record.body,
|
|
370
|
+
});
|
|
371
|
+
if (!response.ok) throw Error("Delivery failed");
|
|
372
|
+
return (await response.json()).ack;
|
|
373
|
+
},
|
|
374
|
+
});
|
|
375
|
+
const id = crypto.randomUUID();
|
|
376
|
+
await outbox.enqueue({ id, events: [] }, id);
|
|
377
|
+
await outbox.flush();
|
|
378
|
+
// Also flush on a host-owned interval, online, and next startup.
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
A successful `enqueue` means the store accepted the record; it does not mean the
|
|
382
|
+
server received it. The server must deduplicate IDs and return the same ID only
|
|
383
|
+
after committing storage. `flush()` leaves records in place on timeout, failed
|
|
384
|
+
transport or a mismatched acknowledgement; it coalesces concurrent calls and
|
|
385
|
+
honors exponential retry backoff. It does not start timers/listeners itself.
|
|
386
|
+
|
|
387
|
+
Defaults: 128 records, 4 MB total, 1 MB each, two-day expiry, five-second attempt
|
|
388
|
+
timeout. Oldest records are pruned under pressure. `stats()` reports pending
|
|
389
|
+
records/bytes, drop/expiry/error/acknowledgement counts, cumulative persistence
|
|
390
|
+
latency and retry time. Counters are per instance. Multiple tabs can resend a
|
|
391
|
+
record and their bounds are not an atomic global quota. Browser eviction and
|
|
392
|
+
storage failure remain possible; persistence errors are surfaced to the host.
|
|
393
|
+
Memory storage is explicit and does not survive reloads. IndexedDB accepts
|
|
394
|
+
bounded JSON batches, not blobs or a full gameplay replay. The custom store and
|
|
395
|
+
transport interfaces allow later adapters without changing game code.
|
|
396
|
+
|
|
397
|
+
Validation: `bun test tests/outbox.test.ts` covers restart recovery, unchanged
|
|
398
|
+
retry IDs, acknowledgement mismatch, overlapping flushes, capacity/age limits,
|
|
399
|
+
timeouts and quota failure. Exercised by Hello World's real browser offline /
|
|
400
|
+
reload / retry workflow.
|
package/changelog.json
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
"contract": 1,
|
|
3
3
|
"name": "@absolutejs/beacon",
|
|
4
4
|
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "added",
|
|
9
|
+
"summary": "A durable browser outbox (@absolutejs/beacon/outbox): bounded IndexedDB or memory storage, acknowledged delivery, retry backoff and pruning",
|
|
10
|
+
"symbols": [
|
|
11
|
+
"BEACON_SDK_VERSION"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"date": "2026-10-24",
|
|
16
|
+
"version": "0.7.0-beta.16"
|
|
17
|
+
},
|
|
5
18
|
{
|
|
6
19
|
"changes": [
|
|
7
20
|
{
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export type BeaconLevel = "fatal" | "error" | "warning" | "info";
|
|
|
25
25
|
/** Response header used to correlate a browser signal with its server request. */
|
|
26
26
|
export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
27
27
|
/** Beacon package version retained with every captured event. */
|
|
28
|
-
export declare const BEACON_SDK_VERSION = "0.7.0-beta.
|
|
28
|
+
export declare const BEACON_SDK_VERSION = "0.7.0-beta.16";
|
|
29
29
|
/** Arbitrary event tags, with Beacon's reserved `signal` tag type-checked. */
|
|
30
30
|
export type BeaconTags = Record<string, string> & {
|
|
31
31
|
signal?: BeaconSignal;
|
package/dist/index.js
CHANGED
|
@@ -192,7 +192,7 @@ var consumeEarlyLayoutShiftBuffer = () => {
|
|
|
192
192
|
|
|
193
193
|
// src/index.ts
|
|
194
194
|
var BEACON_TRACE_HEADER = "x-absolute-trace-id";
|
|
195
|
-
var BEACON_SDK_VERSION = "0.7.0-beta.
|
|
195
|
+
var BEACON_SDK_VERSION = "0.7.0-beta.16";
|
|
196
196
|
var inBrowser = () => typeof window !== "undefined";
|
|
197
197
|
var newId = () => {
|
|
198
198
|
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
|
|
@@ -5031,5 +5031,5 @@ export {
|
|
|
5031
5031
|
redactBeaconEvent
|
|
5032
5032
|
};
|
|
5033
5033
|
|
|
5034
|
-
//# debugId=
|
|
5034
|
+
//# debugId=339819F98DD5749264756E2164756E21
|
|
5035
5035
|
//# sourceMappingURL=index.js.map
|