Zero Code Changes
Introduction
@robelest/convex-embedded is an embedded Convex runtime that runs entirely in the browser. It executes your existing Convex query and mutation functions locally against an in-browser SQLite database, giving your app instant reads, instant writes, and full offline support — all without changing a single line of your Convex function code.
When remote sync is enabled, the embedded runtime becomes a local-first engine: mutations write locally first and replay to the remote Convex deployment in the background. A Yjs CRDT resolve pass automatically merges any state that diverged while offline.
Key Features
Offline-First
CRDT Fields
Cross-Tab Sync
Persistent Storage
Framework Agnostic
When to Use It
convex-embedded is a good fit when you need:
- Local-first applications — users expect instant interactions with no loading spinners, even on slow or unreliable networks.
- Offline support — the app must remain fully functional without a network connection (field workers, mobile apps, airplane mode).
- Collaborative editing — multiple users (or multiple tabs) edit the same data concurrently and expect automatic conflict resolution.
- Reduced latency — reads and writes resolve in microseconds against the local database instead of a network round-trip.
It is not the right choice when:
- You need server-authoritative validation that cannot be replicated client-side (e.g., payment processing, access control that must be enforced server-side).
- Your dataset is too large to fit in the browser’s IndexedDB quota.
- You do not use a Vite-based bundler (the module discovery relies on
import.meta.glob).
Next Steps
Head to the Installation page to add @robelest/convex-embedded to your project, or jump straight to the Quick Start for a step-by-step walkthrough.