@loggerjs/browser 0.5.1 → 0.5.3

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/README.md CHANGED
@@ -58,7 +58,7 @@ Logs batch over HTTP, queue while offline, replay with backoff when the network
58
58
  | Transport | Delivers to |
59
59
  | --- | --- |
60
60
  | `browserHttpTransport` | your collector — batching, offline queue, online replay with backoff, `sendBeacon` on page hide |
61
- | `indexedDbTransport` | a local, queryable IndexedDB store (TTL, pruning, optional Storage Buckets and durability hints) |
61
+ | `indexedDbTransport` | a local, queryable IndexedDB store (session indexes, TTL, pruning, optional Storage Buckets, durability hints, and optional localStorage spill) |
62
62
  | `browserWebSocketTransport` | a WebSocket (codec-encoded batches, queues while closed) |
63
63
  | `browserServiceWorkerTransport` | a service worker for centralized delivery; `ready()` waits for `serviceWorker.ready` with `target: "ready"` |
64
64
  | `browserBroadcastChannelTransport` | other tabs via `BroadcastChannel` |
@@ -68,9 +68,16 @@ Logs batch over HTTP, queue while offline, replay with backoff when the network
68
68
 
69
69
  - `memoryBrowserHttpOfflineQueue()` — short-lived in-memory retry buffer.
70
70
  - `indexedDbBrowserHttpOfflineQueue()` — survives page reloads.
71
- - `exportLogsToZip()` + `downloadBlob()` — export a persisted store as a zip containing `logs.ndjson` and `manifest.json`.
71
+ - `exportLogsToZip()` + `downloadBlob()` — export a persisted store as a zip containing `logs.ndjson` or `logs.json`, `manifest.json`, optional per-session files, and optional `recent.ndjson` or `recent.json`.
72
72
  - Call the `indexedDbTransport()` instance's `stats()` to read flush, prune, query, drop, and buffer-depth counters.
73
73
 
74
+ `indexedDbTransport()` assigns a page-session id by default for browser support
75
+ stores. Use `query({ sessionId })`, `sessions()`, and
76
+ `exportLogsToZip(..., { groupBySession: true, includeRecent: true })` to build
77
+ support bundles around reload-sized sessions. Enable `localStorageSpill` only
78
+ as a bounded last-chance buffer for the still-unconfirmed memory tail during
79
+ ordinary reloads or tab closes; IndexedDB remains the queryable source of truth.
80
+
74
81
  Browser delivery has runtime loss windows: tab close can cut off async work,
75
82
  `sendBeacon` is size- and user-agent-limited, service worker delivery depends on
76
83
  activation and lifetime, and IndexedDB persistence depends on quota and browser