# FKN Developer Docs > System APIs for browser apps (`@fkn/lib`) and app publishing (`fkn.dev`). Use `@fkn/lib` to open raw TCP and UDP sockets, fetch across origins, sync end-to-end encrypted files, run encrypted rooms, drive live websites, and ship signed packages on `fkn.app`. Complete plain-text mirrors: - [All guides, recipes, publishing, and errors (llms-full.txt)](https://docs.fkn.dev/llms-full.txt) - [Generated TypeDoc API reference (llms-api.txt)](https://docs.fkn.dev/llms-api.txt) ## Get started - [Overview](https://docs.fkn.dev/start/overview/): How @fkn/lib extends browser apps, which backend answers each call, what users keep, and how these docs are organized. - [Quickstart](https://docs.fkn.dev/start/quickstart/): Six steps to a page that fetches a URL the browser cannot, keeps the results across reloads, renders the same site in a frame and reads one element out of it. - [Install](https://docs.fkn.dev/start/install/): The package, the subpath choice, the three shims a bundler must supply, and the one runtime requirement. ## Guides - [Backends](https://docs.fkn.dev/guides/backends/): Where a call runs, what the cloud, the extension and the desktop each provide, what available() answers on each, how the root exports choose between them, the hosts every backend refuses, and where each capability runs. - [fetch()](https://docs.fkn.dev/guides/fetch/): How the root fetch chooses a backend, what cloud.fetch sends through the proxy, what extension.fetch adds with the user's session, and how the proxy reports a refusal without throwing. - [TCP and UDP sockets](https://docs.fkn.dev/guides/sockets/): Use Node's net and dgram in the browser, from connecting, writing and listening through socket options, UDP and multicast, the transports underneath, and the one bounded wait in these two modules. - [WebSocket](https://docs.fkn.dev/guides/websocket/): Open the platform's WebSocket through the FKN proxy so the server sees an FKN node's address, with what the constructor refuses, the limits on a connection and what a dropped connection looks like. - [HTTP and DNS](https://docs.fkn.dev/guides/http-and-dns/): Node's http over a net.Socket, the one dns call the broker answers, how the parser frames a body, and why there is no https. - [Workers](https://docs.fkn.dev/guides/workers/): How relayWorker gives a worker access to the broker, what its options do, what a worker that nobody relayed does, and which calls work inside a relayed worker. - [Storage](https://docs.fkn.dev/guides/storage/): The three file systems in @fkn/lib, the in-memory layer behind the synchronous calls, the sync, callback and promise forms, content types, scope and paths, error codes and Stats. - [Sync and conflicts](https://docs.fkn.dev/guides/sync-and-conflicts/): The write and read rules of fs, file states and the drain, adopt(), conflict resolvers, deletes, readFileSealed() and what follows the account. - [Encryption](https://docs.fkn.dev/guides/encryption/): The locked state, unlock() and encryption(), key epochs, and the messages a changed key produces. - [Object storage](https://docs.fkn.dev/guides/object-storage/): How storage.put stores a file under a key your app holds and answers its url, where the encryption runs, how anyone holding the url and the key reads it, listing with a cursor, delete as the only end, the limits and what FKN keeps. - [Rooms](https://docs.fkn.dev/guides/rooms/): What a room is, how a name opens one and an invite joins it, how sealed messages travel, room schemas, claims and the mailbox, the permission model, what survives a reconnect, and the identity a member carries. - [Frames](https://docs.fkn.dev/guides/frames/): What attachFrame() returns, the cookies option that picks the jar and the backend, every option, blank pages, seeding a fresh jar with storageState, goto() and url(), attaching again when FKN reloads, opening the attachment in a window, running code in the page, clearing cookies, frame.fetch() and its two refusals, what is refused with which message, and the timeouts on each path. - [Locators and actions](https://docs.fkn.dev/guides/locators/): The locator chain, every selector and action, the consent each one raises, the video handle, addStyleTag() and the error names. - [Permissions and consent](https://docs.fkn.dev/guides/permissions/): The four categories a grant is made of, the website a grant names, the consent sheet and its answers, ensure() and the upfront asks, the permission keys, the activity log, and the card the cloud backend draws. - [Account and quota](https://docs.fkn.dev/guides/account/): What connect() answers, what an app may read and follow of the account, what logout() clears, the connect button, the relay picker, and the metered volume behind cloud.quota(). - [Packages](https://docs.fkn.dev/guides/packages/): How a host app finds, installs, connects to, shows and mounts a package, how a package answers with onConnect, and the two deadlines and six error codes on the way. - [Connection and lifecycle](https://docs.fkn.dev/guides/lifecycle/): How a call waits for the broker connection, what happens to a call in flight and to an open handle when the broker is replaced, when the broker frame reloads itself, how shell updates and busy tokens fit together, and where the rules for matching an error live. ## Recipes - [Recipes](https://docs.fkn.dev/recipes/): What a recipe is, the four step badges every recipe shares, and the eleven recipes with one line each. - [Run sockets in a worker](https://docs.fkn.dev/recipes/sockets-in-a-worker/): An engine on a worker thread that opens sockets through the relay, bridged from the page and stopped cleanly. - [Give a WebAssembly engine sockets](https://docs.fkn.dev/recipes/wasm-engine-sockets/): An engine written in C, C++, Go or Rust against Node's net and dgram, running unchanged on FKN sockets, with the modules passed in as options, every read copied, and the addresses read once the relay has answered. - [Hold an inbound port](https://docs.fkn.dev/recipes/inbound-port/): Reserve a port that peers can reach, keep it when the relay lets it go, and tell the page plainly when there is none. - [Use the extension or the cloud per request](https://docs.fkn.dev/recipes/extension-or-cloud/): One request path that carries the user's own session when the extension is on the page, goes through the cloud when it is not, and offers the install from inside your own interface. - [Drive a real site and play its video](https://docs.fkn.dev/recipes/drive-a-site/): Another site inside your layout, driven with locators and playing its video, under one consent prompt. - [Back state up to the account](https://docs.fkn.dev/recipes/account-backup/): App state that follows the user to another device, with absence treated as empty. - [Run a chat room](https://docs.fkn.dev/recipes/chat-room/): Two browsers in one room, joined from an invite carried in the page address, with every message sealed before it leaves the tab. - [Sign a user in through a window](https://docs.fkn.dev/recipes/sign-in-window/): An inline site that shows signed out, a sign-in in a child window on the app's own cookie jar, and the inline frame reloaded signed in. - [Install a package and show its UI](https://docs.fkn.dev/recipes/use-a-package/): Install a third-party package from your app, connect to it with a typed remote, and draw its interface over a placeholder or inside an iframe you own. - [Ship a package](https://docs.fkn.dev/recipes/build-a-package/): Bundle a package into one file, answer host connections with onConnect, draw only while the host shows you, fetch and store on the package's own metering, and publish with the keywords that make it findable. - [Bundle an app that uses sockets](https://docs.fkn.dev/recipes/bundling/): A Vite build in which the worker chunk runs, the worker holds the same Node globals as the page, and exactly one copy of the library is loaded. ## Publishing on fkn.dev - [Register and claim sources](https://docs.fkn.dev/publishing/): Register an app on fkn.dev, claim your website via DNS TXT or npm via package.json, pick the main ID fkn.app links it by, declare what fkn.app reads from the package.json fkn field, and delete an app. - [Signing, store media, and payouts](https://docs.fkn.dev/publishing/signing/): Sign npm releases with held or CLI keys, ship verified icons, banners, covers, and screenshots on fkn.app, and configure payouts. ## Errors - [Every error](https://docs.fkn.dev/errors/): Every error @fkn/lib can produce, grouped by fetch, sockets, storage, encryption, frames, locators, permissions, packages, rooms, object storage and the broker, plus the nine that no call reaches, with what happened and whether a retry can succeed. - [Handling errors](https://docs.fkn.dev/errors/handling/): Which fields of an error survive the trip out of the broker, which two errors you can test by class, how to test the rest, what a call the extension never finished rejects with, and which failures are worth retrying. ## Reference - [Entry points](https://docs.fkn.dev/reference/entry-points/): Every import path @fkn/lib ships, what each one gives you, what importing it starts, and the guide that explains it. - [TypeScript](https://docs.fkn.dev/reference/typescript/): Which entry point exports each type, how to derive the shapes @fkn/lib declares but does not export, what the broker's vocabulary in @fkn/lib/contract is for, and how to tell an error you test with instanceof from one you match by message. - [Limits and timeouts](https://docs.fkn.dev/reference/limits/): Every deadline, cap and clamp in @fkn/lib, with its value, where it is applied and what happens once it is reached, grouped by surface. - [Limitations](https://docs.fkn.dev/reference/limitations/): Where the boundary between your page and FKN stays visible in fetch, the sockets, storage, frames, packages and each realm, with the workaround where there is one. - [Glossary](https://docs.fkn.dev/reference/glossary/): Definitions of core terms used across the @fkn/lib and fkn.dev developer documentation. ## Tooling - [@fkn/vite-plugin](https://docs.fkn.dev/tooling/vite-plugin/): The Vite plugin that resolves Node's fs, net, dgram and http to @fkn/lib, the shims it supplies, the options that switch an alias off, and what to use without it. - [Node fs polyfill](https://docs.fkn.dev/tooling/fs-polyfill/): Running unmodified Node fs code on FKN storage through the vite plugin or the @fkn/fs package, the mount() call a synchronous read needs, what that call costs, and what the subset leaves out. - [Testing](https://docs.fkn.dev/tooling/testing/): Testing code that opens sockets on Node's own net and dgram, a mock for a module you only pass through, the four failures you can produce on purpose, and what cannot be simulated. ## Internals - [How it works](https://docs.fkn.dev/internals/how-it-works/): How the library reaches the broker frame, keeps working across broker epochs, projects the overlay, tracks busy tokens, and what it stores and posts on your origin. ## API reference ### Core - [@fkn/lib](https://docs.fkn.dev/api/) - [@fkn/lib network](https://docs.fkn.dev/api/namespaces/network/) - [@fkn/lib shell](https://docs.fkn.dev/api/namespaces/shell/) - [@fkn/lib/account](https://docs.fkn.dev/api/account/) - [@fkn/lib/extension](https://docs.fkn.dev/api/extension/) - [@fkn/lib/packages](https://docs.fkn.dev/api/packages/) - [@fkn/lib/rooms](https://docs.fkn.dev/api/rooms/) - [@fkn/lib/storage](https://docs.fkn.dev/api/storage/) - [@fkn/lib/react](https://docs.fkn.dev/api/react/) - [@fkn/lib/desktop](https://docs.fkn.dev/api/desktop/) - [@fkn/lib/broker-frame](https://docs.fkn.dev/api/broker-frame/) ### Cloud - [@fkn/lib/cloud](https://docs.fkn.dev/api/cloud/) - [@fkn/lib/cloud/fetch](https://docs.fkn.dev/api/cloud/fetch/) - [@fkn/lib/websocket](https://docs.fkn.dev/api/websocket/) - [@fkn/lib/cloud/net](https://docs.fkn.dev/api/cloud/net/) - [@fkn/lib/cloud/dgram](https://docs.fkn.dev/api/cloud/dgram/) - [@fkn/lib/cloud/http](https://docs.fkn.dev/api/cloud/http/) - [@fkn/lib/cloud/dns](https://docs.fkn.dev/api/cloud/dns/) - [@fkn/lib/cloud/fs](https://docs.fkn.dev/api/cloud/fs/) - [@fkn/lib/cloud/fs/promises](https://docs.fkn.dev/api/cloud/fs/promises/) ### Polyfills - [@fkn/lib/net](https://docs.fkn.dev/api/net/) - [@fkn/lib/dgram](https://docs.fkn.dev/api/dgram/) - [@fkn/lib/http](https://docs.fkn.dev/api/http/) - [@fkn/lib/dns](https://docs.fkn.dev/api/dns/) - [@fkn/lib/fs](https://docs.fkn.dev/api/fs/) - [@fkn/lib/fs/promises](https://docs.fkn.dev/api/fs/promises/) - [@fkn/lib/opfs](https://docs.fkn.dev/api/opfs/) - [@fkn/lib/opfs/promises](https://docs.fkn.dev/api/opfs/promises/) ### Boundary - [@fkn/lib/contract](https://docs.fkn.dev/api/contract/) - [@fkn/lib/wire](https://docs.fkn.dev/api/wire/) - [@fkn/lib/messages](https://docs.fkn.dev/api/messages/) - [@fkn/lib/attach-policy](https://docs.fkn.dev/api/attach-policy/) - [@fkn/lib/api](https://docs.fkn.dev/api/api/)