@edgeflowjs/sync
v0.2.2
Published
Offline-first outbox queue with SQLite persistence and retry.
Downloads
395
Readme
@edgeflowjs/sync
Offline-first outbox queue with SQLite persistence and retry.
Install
pnpm add @edgeflowjs/syncExports
createSqliteStore— SQLite-backed store (production)createMemoryStore— In-memory store (tests, SQLite unavailable)createSyncEngine— High-level engine with retry loopcreateSqliteCrashStore,createFileCrashStore— Crash report persistence- Types:
SyncStore,SyncEngine,OutboxEvent,OutboxStatus,CrashStore
Usage
import { createSqliteStore, createSyncEngine } from "@edgeflowjs/sync";
const store = createSqliteStore("./data/edgeflow.sqlite");
const sync = createSyncEngine(store, { sinkUrl: "https://api.example.com/events" });
await sync.start();
await sync.enqueue("scan.completed", { code: "QR123" }, { idempotencyKey: "scan-1" });
const stats = await sync.stats();