Overview
@fkn/lib extends a standard web app with system capabilities that browsers normally block: raw TCP and UDP sockets, cross-origin fetch() and WebSocket, end-to-end encrypted file and object storage, encrypted realtime rooms, live website framing, and sandboxed third-party packages. It runs on a web page, inside a dedicated Web Worker, and inside sandboxed packages.
How the architecture fits together
Section titled “How the architecture fits together”Your app stays a regular browser bundle. When it imports @fkn/lib, the library connects to FKN through the broker frame or the extension backend, depending on what the user has installed and what each call requests.
- Cloud backend: Works out of the box for every visitor with zero installs. Traffic travels through FKN relays (WebVPN) or the HTTP proxy, and files sync to the user’s encrypted cloud storage.
- Extension backend: When the visitor has the FKN browser extension installed,
fetch()andattachFrame()can run straight from their own browser using their existing cookies and sessions, after explicit per-site consent. - Worker and package runtimes: Dedicated Web Workers can open sockets and fetch via
relayWorker(). Third-party packages run on isolated sandbox origins undersdbx.appand talk to your app over typed message channels.
See backends for exact routing rules and glossary for key terms used across these docs.
What people using your app keep
Section titled “What people using your app keep”Every app built on FKN shares one user-owned account model:
- Their files: Files and objects encrypt inside the user’s browser before upload. FKN servers hold ciphertext only and cannot open them.
- Their sign-in: Users sign in on
fkn.appwith their password or passkey. Your app never sees their password, email address, or account key. - Their permissions: Users approve site interactions one origin at a time and can revoke any grant from the FKN bar or
fkn.app. - Free to use: FKN is free for users and free to build on. Each user gets one daily allowance across every app they open and can choose Premium on
fkn.appfor higher limits.
For exact plan allowances and privacy guarantees written for end users, see plans and your allowance and your data.
Where to go next
Section titled “Where to go next”- First 5 minutes: Follow the quickstart to fetch a cross-origin URL, persist a file, and drive an attached frame, or read install for Vite and bundler setup.
- API guides: Pick one surface under Guides in the sidebar, starting with backends, fetch(), TCP and UDP sockets, storage, rooms, or frames.
- Task recipes: Follow end-to-end recipes under recipes for worker sockets, C/WASM engines, chat rooms, sign-in flows, and production bundling.
- Shipping on fkn.dev: Read register and claim sources and signing, store media, and payouts to verify your app on
fkn.app. - Reference: Look up entry points, limits and timeouts, limitations, every error, and the generated API reference.
- Machine-readable docs: Read
/llms.txtfor a concise page map,/llms-full.txtfor all guides, recipes, publishing docs, and errors in one file, and/llms-api.txtfor the full API reference. - User help: Looking for non-developer help? Visit the FKN Help Guide.