Someone fills in a form on a train, in a basement, or on bad Wi-Fi. They tap save. The request fails and the work is gone.
A small TypeScript library that guarantees mutation delivery. It records a change, stores it safely, and sends it once the connection returns. It does that without asking you to adopt a local database, rewrite your API, or commit to a particular framework.
- Four calls carry the whole surface: mutate records a change, flush sends it, and events report what happened. SyncForge never interprets the operation type, so the vocabulary stays yours.
- The core owns the operation lifecycle. Two pluggable adapters own everything else, which keeps the engine testable and the integration shallow.
- The transport adapter maps an operation to your backend, whether that is REST, GraphQL, tRPC or something bespoke. Existing APIs need no changes.
- The storage adapter persists the queue across reloads. In-memory and IndexedDB backends ship with it.
- Automatic sync on reconnect, configurable retry strategies, optimistic updates, and lifecycle events for queued, syncing, succeeded and failed.
- A companion package, syncforge-react, adds a provider and the useSyncEngine, useSyncFlush and useSyncStatus hooks over the same engine.
- The core engine, IndexedDB persistence, auto sync, retry strategies, optimistic handlers and the React hooks all carry tests.
- MIT licensed, developed in the open, and in active development toward a 1.0.
