Installation
Prerequisites
Before installing, make sure you have:
- An existing Convex project (run
npx convex initif you do not have one). - A Vite-based bundler (Vite, SvelteKit, Next.js with Turbopack, etc.) — the embedded runtime uses
import.meta.globfor module discovery. convex^1.32.0 as a peer dependency.
1. Install the Package
2. Install the Convex Component
The CRDT sync engine uses a Convex component for server-side delta storage. Install it with:
npx convex component add @robelest/convex-embedded This registers the component in your convex.config.ts and makes components.embedded available in your generated API.
Package Exports
@robelest/convex-embedded ships multiple entry points so you only import what you need:
| Export | Environment | Description |
|---|---|---|
@robelest/convex-embedded/browser | Browser | createConvexClient factory, getResolveState, subscribeResolveState, getAuthState, subscribeAuthState, preload utilities |
@robelest/convex-embedded/server | Convex backend | embeddedTable, setup, remoteOnly |
@robelest/convex-embedded/crdt | Convex backend | schema namespace (register, prose, counter, set, omit) |
@robelest/convex-embedded/worker | Web Worker | wa-sqlite worker entry point |
@robelest/convex-embedded/client | Browser | Internal resolve engine (not part of the public API) |
@robelest/convex-embedded/convex.config | Convex | Component configuration |
@robelest/convex-embedded/test | Test | Testing utilities |
Most applications only need browser, server, and crdt.
Next Steps
Continue to the Quick Start to define your first embedded table, set up server bindings, and create a client.