What is Pear?
Pear in plain language—what the platform adds to the peer-to-peer building blocks, how an app reaches its users, and what Pear is not.
Pear is a platform for building, distributing, and updating peer-to-peer applications: a CLI to build, stage, provision, and seed releases, and Pear OTA (pear-runtime), a library your app embeds to update itself. A Pear app is an ordinary desktop, mobile, or terminal program—Electron, React Native, or a standalone Bare binary—whose peer-to-peer core finds other users directly, stores data on the user's own device, and fetches its own updates from the people already running it. You don't host, scale, or pay for a server to do any of that.
Want to build something? Getting started takes you from install to a released app, and How To has task-by-task guides.
Looking up an API or a command? Reference covers the pear CLI, Pear OTA, and the pear-* modules.
The problem Pear solves
In many apps described as peer-to-peer, only the data moves between peers. The app itself often still arrives from an app store or a download server, updates still come from a CDN, and discovery still runs through someone's infrastructure. Each of those is a server someone has to keep running and a point where the app can be taken down, altered, or made to phone home.
The peer-to-peer building blocks—Hypercore, Hyperswarm, Autobase, and the rest, documented on the P2P tab—solve the data half: append-only logs that replicate between peers, a DHT for finding them, and multi-writer databases on top. They are ordinary JavaScript modules and work in any Node.js or Bare program.
Pear solves the other half. It treats the application as just another piece of replicated data. Your build is written into a Hyperdrive, addressed by a pear:// link that is really a public key, and seeded by whoever has it—you, your CI, and every user running the app. New versions reach users the same way a new chat message does: a peer notices the drive has grown and pulls the difference.
What's in the box
Three pieces, which you'll meet in roughly this order:
- The
pearCLI—the operator's tool.pear touchmints a link,pear stagewrites a build into the drive behind it,pear seedkeeps it available,pear provisionpromotes a staged version to a leaner release drive, andpear multisigrequires a quorum of signers before production changes. Release pipeline explains why those steps are separate. - Pear OTA, the
pear-runtimelibrary—the piece that goes inside your app. It watches the drive behind the app'supgradelink, downloads new versions, tells your UI when one is ready, manages the app's peer-to-peer storage, and spawns Bare workers for your peer-to-peer code. Younpm installit like any dependency. - The
pear-*modules—host integrations and services around the runtime:pear-electronfor desktop,pear-mobilefor React Native and Expo, plus the bridges, aliases, and IPC helpers the module catalog lists.
Pear is built on the building blocks and on Bare. It doesn't replace or wrap them; your app imports Hyperswarm directly, and Pear's own distribution runs on the same Hypercore and Hyperdrive you use for your data. How the stack fits together draws the layers.
What a Pear app looks like
The recommended shape, and the one the official hello-pear-electron template ships, splits an app in two. Start from the hello-pear-electron template walks through it:
- A portable core that runs in a Bare worker: the Hyperswarm connections, the Corestore, the Autobase room, and the
pear-runtimeupdater. It never touches a DOM or a native view, so it is the same code on every platform. - A thin UI host that changes per platform: Electron on desktop, a native shell with a Bare worklet on mobile, a terminal for a CLI app. It talks to the core over one IPC stream.
That is why one Pear app can ship on macOS, Windows, Linux, iOS, and Android from one codebase: only the host swaps. Pear desktop application architecture, Pear mobile application architecture, and Workers each take one piece of that picture apart.
How an app reaches its users
Day one, a user installs your app the way they install anything else—a signed installer, an app store, a pear install pear://... link, or a binary you hand them. Pear doesn't change first install.
From then on, Pear owns updates. The installed app carries its pear:// upgrade link. Its updater joins the swarm for that link, finds peers that have the drive—your seeder, your CI, other users—and downloads new versions as they appear. When a download is complete the runtime emits an event and your UI decides when to apply it. Storage and distribution covers where all of this lands on disk and what "keep pear seed running" actually means; Availability and distribution covers keeping a drive available when you're offline.
Because a pear:// link is a key, not an address, the update path doesn't depend on a domain or a certificate authority. Anyone holding the drive can serve updates; only holders of the signing keys can publish them.
What Pear is not
- Not a UI framework. Pear has no opinion about React, Svelte, Tailwind, or plain HTML. The renderer is yours.
- Not a blockchain. There is no token and no global ledger. Hypercore is a signed append-only log owned by one writer; Autobase orders the writes of several of them, with a quorum of indexers settling that order among the app's own peers.
- Not a hosting service. Nothing runs on Holepunch's machines on your behalf. Availability comes from peers you run or your users run.
- Not required for peer-to-peer. The building blocks work without Pear. Reach for Pear when you want to ship and update an app, not just move data.
How Pear got here
Pear v1 and v2 shipped a single vendor-signed runtime that launched every app with pear run and exposed an ambient Pear global. It made shipping trivial—no OS signing keys, no native compiling—but one shared runtime binary couldn't be tested against every app, confused OS update mechanisms and antivirus software, and made branding glitchy. Pear v3 removed pear run and moved the runtime into an embeddable library, pear-runtime, that lives inside your own process. The CLI kept the deployment commands. If you have an older app, Migrate from pear run to Pear OTA is the path across; Runtime and languages has the fuller reasoning.
Read next
In this order, if Pear is new to you:
- How the stack fits together—the one diagram that places Pear, P2P, and Bare.
- Pear desktop application architecture—what a real app's processes and workers look like.
- Release pipeline—how a build becomes a release that your users receive.
Then go build one: Getting started.
Last updated on