Installation
Prerequisites
Before installing, make sure you have:
- An existing Convex project (run
npx convex initif you do not have one). convex^1.32.0 as a peer dependency.
1. Install the Package
@robelest/convex-embedded depends on the standalone @robelest/fx package
internally. You do not need to install @robelest/fx separately unless you are
also using its lower-level APIs directly in your own code.
2. Install the Convex Component
The CRDT remote engine uses a Convex component for server-side delta storage.
Register it in convex/convex.config.ts:
// convex/convex.config.ts
import embedded from "@robelest/convex-embedded/convex.config";
import { defineApp } from "convex/server";
const app = defineApp();
app.use(embedded);
export default app; After running npx convex dev or npx convex codegen, this 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, getRemoteState, subscribeRemoteState, getAuthState, subscribeAuthState, preload utilities |
@robelest/convex-embedded/server | Convex backend | embeddedTable, setup, localOnly, 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.