Skip to content

After your first local app · Experimental alpha

Connect an app to Personal Node.

Start with an app that saves data and works offline. Add a node when you want another copy of selected data, or want a compatible app to read that copy while the original app is closed.

Use a node when…

Users want to keep shared data on a trusted desktop, inspect sync status, or make copied data available to permitted apps. Design this as an optional connection; basic app use must work without it.

Keep the app independent when…

Local storage is enough, or you only need direct calls between reachable peers. A node does not automatically host your app’s functions, connect arbitrary apps, or provide a complete backup and restore service.

1. Try the working two-app example

Use a repository checkout, Node.js 22.17+ and npm. These are command-line apps backed by the actual desktop node. Use disposable notes. The demonstrated desktop flow uses public discovery with all processes on one computer; it does not establish physical-device or signed-installer acceptance.

bash
# From the repository root
npm ci --prefix packages/p2p
npm ci --prefix packages/node
npm ci --prefix packages/node-desktop
npm ci --prefix examples/personal-node-ecosystem
npm run dev --prefix packages/node-desktop

Keep the desktop running. In another terminal, create a note, then choose Connect an app in Simple Home. Replace NODE_CODE_FOR_NOTEBOOK below with the new code. Simple codes allow data sharing, not AI access.

bash
cd examples/personal-node-ecosystem
node notebook.js put launch "Launch plan" "Ship a useful local app"
node notebook.js serve --node-invite NODE_CODE_FOR_NOTEBOOK

Wait for verified checkpoint. Notebook prints a separate invitation for its own service. In another terminal, from the same example directory, link Briefing with that Notebook invitation:

bash
node briefing.js link --invite NOTEBOOK_CODE

Now stop Notebook with Ctrl+C. Create a fresh code in Personal Node for Briefing, then run:

bash
node briefing.js sync --node-invite NODE_CODE_FOR_BRIEFING --stay-open

Briefing retrieves the copied notes from the node and saves its report. In Simple Home, choose Browse saved data on each app to see the note and report cards. Notebook should be disconnected with its copy still available. To show both apps connected, restart Notebook with the node public key printed during pairing:

bash
node notebook.js serve --node-key NODE_PUBLIC_KEY

The node stores replicated data. Live Notebook summary or watch calls still require Notebook running. Stop each process with Ctrl+C before opening its local store in another process.

2. Connect your own app deliberately

The scaffold does not do this automatically. Follow the example runtime in a supported Node or Bare worker; renderer code talks to that worker through IPC.

  1. Choose what to share. Keep private data separate. Register only supported Hypercore, Hyperbee, or Hyperdrive resources that the user intends to copy. Apps own schemas, migrations, and writer rules.
  2. Attach replication to your existing storage. Add syncPack({ store }) to the app’s P2P runtime. Reuse its owned store and identity; avoid opening a second writer over the same directory.
  3. Pair with permission. Use node.pair(invite) with a desktop-created code. Save the paired node public key for node.connect(publicKey) on later runs. Keep invitations private; a remembered key does not bypass revocation.
  4. Declare resources. Call peer.call('sync', 'manifest.replace', { manifest }) with the complete intended resource list, stable IDs, keys, names, and protection.mode: 'mirror'. Registration alone does not mean the data has been copied.
  5. Confirm the checkpoint. Query sync.status and verify the intended resource and version are protected. Handle refusal, quotas, disconnections, timeouts, and cancellation without blocking local use.
  6. Share across apps through a contract. Agree on schema versions and capabilities. Attach replication and download the required checkpoint before reading. A data replica does not transfer domain handlers to the node.

3. Verify the behavior you promise

Test local writes without the node, reconnection and updated copies, reads with the source app stopped, denied access, and node restarts. Check both connection and copy status. Use the example’s automated proof and desktop acceptance runner as starting points.

Personal Node remains outside the core preview. Retention, complete recovery, and the full device-linking journey are unfinished. A same-computer node does not protect against losing that computer. Collaborative database hosting with Node sync is not yet a supported combination.