What problem does it solve?
Offline transaction support for TanStack DB provides durable, offline-capable mutations by persisting an outbox and coordinating execution across tabs or devices. It ensures data integrity during disconnects and automatic recovery when connectivity returns.
Core Features & Use Cases
- Persistent outbox using IndexedDB/localStorage
- Leader election to avoid duplicate processing across tabs
- Retry with exponential backoff and idempotency keys for at-least-once delivery
- Online fallback when storage is unavailable; React Native support via a separate entry point
- Integration with db-core and mutations-optimistic to wrap vanilla mutations with offline persistence
- Out-of-band replay to apply pending mutations on startup or reconnect
- Optional storage adapters and configurable detectors for connectivity changes
Quick Start
Initialize the Offline Executor and wait for initialization before creating transactions.