Installation

Prerequisites

Before installing, make sure you have:

  • An existing Convex project (run npx convex init if 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:

ExportEnvironmentDescription
@robelest/convex-embedded/browserBrowsercreateConvexClient factory, getRemoteState, subscribeRemoteState, getAuthState, subscribeAuthState, preload utilities
@robelest/convex-embedded/serverConvex backendembeddedTable, setup, localOnly, remoteOnly
@robelest/convex-embedded/crdtConvex backendschema namespace (register, prose, counter, set, omit)
@robelest/convex-embedded/workerWeb Workerwa-sqlite worker entry point
@robelest/convex-embedded/clientBrowserInternal resolve engine (not part of the public API)
@robelest/convex-embedded/convex.configConvexComponent configuration
@robelest/convex-embedded/testTestTesting 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.