Skip to content

get-convex/automerge-sync

Repository files navigation

Convex Automerge Sync Component

npm version

Note: Convex Components are currently in beta

  • What is some compelling syntax as a hook?
  • Why should you use this component?
  • Links to Stack / other resources?

Found a bug? Feature request? File it here.

Pre-requisite: Convex

You'll need an existing Convex project to use the component. Convex is a hosted backend platform, including a database, serverless functions, and a ton more you can learn about here.

Run npm create convex or follow any of the quickstarts to set one up.

Installation

Install the component package:

npm install @convex-dev/automerge-sync

Create a convex.config.ts file in your app's convex/ folder and install the component by calling use:

// convex/convex.config.ts
import { defineApp } from "convex/server";
import automergeSync from "@convex-dev/automerge-sync/convex.config";

const app = defineApp();
app.use(automergeSync);

export default app;

Usage

import { components } from "./_generated/api";
import { AutomergeSync } from "@convex-dev/automerge-sync";

const automergeSync = new AutomergeSync(components.automergeSync, {
  ...options,
});

See more example usage in example.ts.