Swarm
Build on Swarm
window.swarm gives every page a consented line to the user's own Swarm node. Publish, keep state in feeds, sign and message, with no gateway, server or API key.
Freedom Browser runs a Swarm node inside the browser, and
window.swarm is how a page uses it. It is Freedom's
implementation of the provider API proposed in
SWIP #94, so what you build
here targets an open standard rather than one browser.
Why build on window.swarm#
The user's node is the backend
Pages publish and read through the user's own Swarm node. It is the only way a page reaches the node: the node's local HTTP API is blocked for web content.
Consent per origin
Grants belong to the address-bar origin and come in tiers, from connecting to publishing, feeds, messaging and signing. Limits and read budgets are enforced by the browser.
Mutable state on immutable storage
Feeds give your app a stable, signed pointer to the latest version of its content, or an append-only log of entries.
Real time without servers
GSOC rooms and encrypted PSS direct messages deliver live updates through the user's node, while feeds stay the source of truth.
An open standard
Every method in the reference carries a SWIP #94 status badge, and swarm-kit's provider-compliance example checks an implementation against the draft.
Start here#
Quickstart
From an empty HTML file to an app served from Swarm: detect Freedom, connect, publish, keep state in a feed, deploy.
Feeds and mutable content
A stable URL for changing content, append-only data logs, and reading other users' feeds.
Live messaging
GSOC broadcast rooms, encrypted PSS direct messages, subscriptions, and how to combine them with durable data.
swarm-kit
Higher-level data structures over window.swarm: records, feeds, hash chains, multi-writer feeds, encryption and live messaging.
window.swarm reference
Every method, error, permission tier and limit, with its SWIP #94 status.
Before you publish#
Publishing spends postage, so the user's node needs storage first. If it has
none, Freedom opens its publish setup for the user the first time a page
tries to publish; reads work without it. The
Quickstart walks through this, and the reference lists the
readiness errors (node-not-ready, ultra-light-mode, no-usable-stamps)
under Errors and the size and rate caps under
Limits.
Two guides apply to Radicle as well and live in the Overview tab: Permissions and identity and Errors and node readiness.
Related demos#
Freedom Community
Communities on Swarm: members write to their own feeds; a steward is woken by a GSOC doorbell.
window.swarm GSOC
swarm-kit examples
Chat over PSS and GSOC, a playground for every data structure, and provider compliance checks.
window.swarm swarm-kit