@fkn/lib gives a web app sockets, a fetch free of the page’s cross-origin rules, a file system with a copy in the user’s account, another website in an iframe you can drive, and third-party packages. It runs on a page, in a worker the page relays, and inside a package, an npm module FKN loads on a sandbox origin of its own. This page covers which backend answers a call and what every page here teaches.
To see it working first, the quickstart is the whole idea in one page.
A backend is where a call runs. The cloud is FKN’s own infrastructure and needs nothing installed. The extension is the FKN browser extension, so a call runs in the user’s own browser and asks them before it spends something of theirs. The desktop app is planned, and desktop.available() answers false today.
A cloud call leaves the page over the broker, the connection your page holds into FKN. cloud.fetch then goes through the proxy, the server that makes the request for you, and net and dgram through the relay, the server that holds the real socket. The root exports pick a backend for you, and each namespace pins one:
quickstart builds a page in six steps that fetches a URL the browser cannot, keeps the result, and reads a heading out of a real site, with nothing installed.
install adds the package and names the three shims your bundler must supply.
workers explains what relayWorker does, what a worker nobody relayed does, and which calls work inside a relayed one.
storage covers the three file systems, fs, opfs and cloud.fs, and the in-memory layer behind the synchronous calls.
sync and conflicts covers what the account copy, the copy of a file kept in the account, asks of your app: the read and write rules, conflicts and deletes.
encryption covers the one state an app sees, locked, key epochs, and the messages a changed key produces.
frames covers attachFrame(), its two backends, every option, goto(), frame.fetch(), and what is refused.
locators and actions covers the locator chain, a Locator built by chaining selectors, every selector and action, and the video handle.
permissions and consent covers the consent sheet, the prompt the extension shows before an action that needs approval, the twenty permission keys such as read.text, and the activity log, the on-device record of what an app did.
packages covers both sides of the contract: the host app that installs, connects to and shows a package, and the package that answers with onConnect.
rooms covers a realtime room: the invite, sealed messages, the permission model, what survives a reconnect, and the identity a member carries.
connection and lifecycle covers what waits for the broker and what gives up, a broker replaced under a call, and busy tokens, the reasons a page reports itself busy.
how it works explains the broker frame, the hidden fkn.app iframe that carries the broker, how calls keep working when the broker is replaced, the overlay, and what the library stores on your origin.
The pages under API reference are generated from the source, so check an exact signature there.