@fkn/lib gives browser apps networking and page-automation primitives that the web platform does not provide on its own. The cloud networking APIs and isolated frame backend are available directly from browser code with no extension or account. Cloud storage is separate and requires a connected account. The optional extension adds a second backend for capabilities that should run in the user’s browser.
The net and dgram shapes are also published standalone as @webvpn/net and @webvpn/dgram, which is how projects like libtorrent-wasm run a BitTorrent client in the browser.
The root net, dgram, http, and dns exports are aliases of these cloud implementations today. Bare fetch() can choose between the extension and cloud, while attachFrame() has a separate extension-or-cloud rule. The desktop namespace is a typed placeholder for a future backend. See API backends for the exact behavior.
Platform networking primitives by execution backend
All APIs below are called from browser code. The columns show which backend performs the work.
Socket APIs prefer WebTransport and fall back to WebSocket when WebTransport is unavailable or does not become ready. Safari therefore uses WebSocket, while supported Chromium and Firefox versions normally start with WebTransport.
On the WebTransport path, TCP sockets ride QUIC streams with flow control and congestion control. UDP sent from the browser uses WebTransport datagrams. Since @fkn/lib 0.4.2, server-to-browser UDP uses one QUIC stream per socket, avoiding Chromium’s datagram pacing cap on that direction while preserving UDP semantics for application code. Prefer TCP for bulk transfer when the remote service offers both.
Free-tier usage has a 5 GB daily allowance and is throttled after that point. Connected traffic is metered per account; anonymous traffic is metered per IP. No account is required, and an app can read the current quota and throttle rate.