Home > Engineering > Third Party Software > Pear > pear-runtime

pear-runtime

pear-runtime lets a host app embed Pear’s P2P runtime as a library: running Bare workers, giving the app its storage, and taking P2P over-the-air updates. Since Pear v3 (July 2026) it is how Pear apps run: pear run is removed (see the Pear overview). The docs now call it Pear OTA; the package name stays pear-runtime. It builds on Bare and uses Corestore, Hyperswarm and Hyperdrive underneath.

MVP and experimental. npm is at 1.3.1 (1 July 2026), and the README still says “MVP - EXPERIMENTAL”. Its “Making updates” section is headed “VERY EXPERIMENTAL, MOST DEFINITELY WILL CHANGE.” Pin a version and treat the API as moving.

Supported on macOS, Linux and Windows. For mobile, the sibling is pear-mobile (with pear-runtime-react-native).


Core API

See the README and the runtime reference for full detail.


OTA updates

Updates come from pear.updater, a pear-runtime-updater instance (npm 3.4.0). Its events run update-scheduled → updating (with updating-progress) → updated; pear.updater.applyUpdate() applies the update, which swaps paths on disk so the next process start runs the new code.

The release side is CLI-driven: pear touch allocates the Pear link (stored as upgrade in package.json), pear build makes the deployment folder, pear stage publishes previews, and pear provision with pear multisig makes the production release, kept available with pear seed.

For a desktop app, hello-pear-electron runs pear-runtime inside a Bare worker with Electron as a thin shell. For a terminal app, hello-pear-bare embeds it in the Bare worker of a Bare CLI; hello-pear-daemon runs the updater as a detached daemon.

See Also