Skip to content
Pixel-art computers connected peer to peer around an encrypted document.

Local-first
TypeScript state.
End-to-end
encrypted.

Your servers never see document plaintext. Wrap Automerge or Yjs with local storage, peer-to-peer sync, and React bindings.
/workspace/release
A Client A● Online
workspace.ts local state
{
  "title": "Release plan",
  "status": "review",
  "tasks": [
    "Design schema",
    "Write tests",
    "Ship offline"
  ]
}
B Client B● Online
workspace.ts local state
{
  "title": "Release plan",
  "status": "review",
  "tasks": [
    "Design schema",
    "Write tests",
    "Ship offline"
  ]
}
SIMULATED FRAMES · NO LIVE NETWORK
[Peerborne] Epoch 4 -> Epoch 5 transition complete[P2P] 124B delta synced via minimal common ancestor
Scripted illustration. No Peerborne node, real transport, cryptographic operation, or measured timing runs here. The 124B frame and epoch transition are sample text; reconnecting does not itself rotate keys. CRDT rules select a scalar value; convergence does not preserve both scalar edits. Try the in-page Yjs exerciseor run the real browser example.

Alpha · source workspaces only · not production-ready. Build from this repository; packages are not published to npm. See the capability and evidence audit.

Real-time sync

WebRTC and Circuit Relay v2 transports, with GossipSub document updates. Configure reachable bootstrap/relay peers; there is no hosted zero-config network. Connect clients →

Encrypted collaboration

AES-GCM document encryption, signing by default, ACLs, and epoch key rotation primitives. Relays see encrypted payloads and traffic metadata. Forward secrecy and MLS are not implemented. Read the security model →

Control over client cost

CRDT deltas, change transactions, bounded block fetching, and opt-in compaction. Measure your workload: linear scaling, main-thread latency, and batched disk I/O are not established guarantees. Inspect performance →

Bind a document to React. Edit a typed object; the Automerge adapter produces CRDT updates and Peerborne handles document encryption and publication.

Workspace.tsx
import { usePeerborneDocumentState } from '@peerborne/react';
import type { WorkspaceNode } from './peerborne';
export function Workspace({ peerborne }: { peerborne: WorkspaceNode }) {
const [doc, change, , error] = usePeerborneDocumentState(peerborne, '/workspace', 'all', 'create');
if (!doc) return <p>{error ? 'Could not create workspace' : 'Opening…'}</p>;
return <button onClick={() => change((draft) => {
draft.title = 'Ready to ship';
})}>{doc.title ?? 'Name this workspace'}</button>;
}

This uses the shipped usePeerborneDocumentState hook after node initialization and context setup. WorkspaceNode is a type from the companion application module. Copy the complete setup and entry point. The hook returns void and drops mutation rejections; use await document.change(...) when a save action must report failure.

Build this workspace

UI and React hook connected to an in-memory CRDT; signed and encrypted updates flow to the Helia blockstore and libp2p, with epoch keys supplied to the crypto layer.

Encryption comes before storage and transport. Change transactions combine mutations; they are not a durable batching WAL. Read the architecture or use the Mermaid diagram source.

Peerborne composes these CRDT engines. Choose it when you want to experiment with their merge semantics inside an encrypted peer-to-peer stack.

Peerborne Yjs + providers Automerge + Repo WebSockets + Postgres
Transport libp2p; WebRTC / configured relays Choose a network provider Choose Repo adapters App server broadcasts
Document E2EE Built in; group lifecycle is alpha Provider/application choice Separate from baseline Repo Add application encryption
Storage Encrypted Helia blocks / IndexedDB Add persistence provider Repo storage adapter Server database + app cache
Client memory Loaded CRDT + graph/caches; no total cap Loaded CRDT + metadata Loaded docs + history Choose a client working set

Yjs providers can add encryption, including a shared password in y-webrtc. This compares the baseline architectures; it does not rank speed, maturity, or safe document sizes. See sources and trade-offs.

Inspect the benchmark sources and measurement guide: crypto operations, simulated update delivery, and index queries are different workloads. The committed benchmark snapshot records its machine, runtime, source commit, and sample counts. A pinned ESM runner makes the workloads reproducible; the guide includes bounded smoke commands. Results remain informational, with no CI performance thresholds or browser frame-budget guarantee.

The default browser smoke test opens one real encrypted document. A separate cross-NAT acceptance suite verifies a signed distinct-identity invitation and live bidirectional updates through Circuit Relay. Partition/rejoin convergence, restart recovery, and relay failover still need stronger evidence. Review current limits →

04 · API Reference

Explore the TypeScript APIs for all six source workspaces, generated directly from their source declarations.

Building an encrypted editor or workspace? Star Peerborne to follow development, or bring an API question to Discussions. Contributions and reproducible bug reports help shape the next release.