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" });
});