LogoPear Docs

Getting started

A four-part onboarding path that takes you from a 5-file local Pear chat to a production-shaped Electron app to a live OTA cycle and a multisig release, mirroring the hello-pear-electron template.

Build a peer-to-peer desktop chat app with Pear, then evolve it into the same shape as the official hello-pear-electron template, and finally release it over the air.

Each part is a single sitting. Read them in order — every part starts from the previous part's code.

What you'll build

A small Electron window with a message list, an input, and a peer counter. Two instances on the same machine — or on different machines anywhere on the public internet — discover each other through the DHT and stream messages directly.

window.chat / window.bridge IPC PearRuntime.run / new PearRuntime Hyperswarm renderer/app.js (HTML + JS) electron/preload.js electron/main.js (Electron main process) workers/main.mjs (Bare) remote peers

Each part adds one layer to that picture:

  • Part 1 wires the renderer ↔ main ↔ worker ↔ peers path with the smallest amount of code.
  • Part 2 replaces the static PearRuntime.run with the real new PearRuntime({ ... }) instance, plumbs OTA events through the bridge, and gives the worker a Corestore so messages survive a restart.
  • Part 3 turns the project into a release pipeline: signed distributables, a pear:// upgrade link, and the first published version on a Hypercore.
  • Part 4 puts that release pipeline in motion: run the installed app, ship a second version, watch OTA fire end-to-end, and preview the production stage → provision → multisig flow from the release pipeline.

Before you start

  • Node.js v22.17 or newer and npm v10.9 or newer
  • A POSIX-style terminal (macOS, Linux, or Windows with WSL)
  • An IDE or text editor
  • The pear CLI (npx pear) — only required for parts 3 and 4

Each part lists any extra npm packages it adds.

Where to go next

On this page