Developer Documentation

Drop-in local-first state in 5 minutes.

Install the zero-dependency WASM core in React, Vue, Svelte, Astro, or native Rust services and watch offline conflicts disappear.

01 TypeScript SDK

Initialize an Offline-First Store

Bind a typed document schema to local SQLite OPFS and attach the background delta sync worker.

import { createNomadStore, crdt } from "@nomadsync/client";

export const doc = createNomadStore({
  docId: "architecture-spec-04",
  storage: "sqlite-opfs",
  relayUrl: "wss://edge.nomadsync.dev/v3",
  schema: {
    title: crdt.lww("Untitled Monograph"),
    body: crdt.fugueText(),
    frames: crdt.map<FrameNode>(),
  },
});

// Commits locally in < 0.6 ms even while completely offline
doc.transact((tx) => {
  tx.frames.set("f1", { x: 420, y: 180, label: "Hero Spread" });
});
02 Rust / WASM Core

Inspect Wire Delta & Merge Proof

Export compact binary state vectors for peer-to-peer WebRTC or custom transport synchronization.

use nomadsync_core::{Replica, StateVector};

let mut peer_a = Replica::new("actor_zurich");
let mut peer_b = Replica::new("actor_tokyo");

peer_a.insert_text("body", 0, "deterministic ");
peer_b.insert_text("body", 0, "local-first ");

let delta = peer_b.export_delta_since(&peer_a.state_vector());
peer_a.apply_delta(&delta)?;
assert_eq!(peer_a.read_text("body"), peer_b.read_text("body"));