@fkn/lib gives a browser app access to FKN’s cloud networking, storage, account, and page-automation APIs. Cloud networking and isolated page automation need no extension or account; cloud storage requires a connected account. Install the optional FKN browser extension when your app needs to use the user’s browser, cookies, or logged-in session.
Use ESM imports in your app. The package includes TypeScript declarations, and the examples on this site are type-checked against the published release.
No account is required. Anonymous cloud use is metered per IP; connecting an account moves metering to that account. See Quota and throttling.
For a request that can use either the extension or cloud, import the root fetch() instead. The exact selection rules are documented under API backends.
If the extension is exposed, attachFrame() uses it; otherwise it starts the cloud backend with no install prompt. Pass syncCookies: false when the frame should use an isolated per-attach cloud session instead of the persistent cloud jar.
A frame that must use the user’s existing browser session needs the extension backend: pin it with extension.attachFrame(), which waits for exposure and surfaces the install flow when the extension is missing. On the cloud backend the user’s session comes from logging in inside the proxied page itself, and the default cookie mode keeps that login in the persistent cloud jar across attachments.
waitForExtensionExposure() rejects when the extension is not installed. By default, an extension-required call also opens FKN’s install prompt. Apps with their own absence UI or cloud fallback can suppress that prompt:
Extension APIs are explicit under extension.*. Sensitive operations prompt for per-app consent; severity-0 operations are granted automatically and recorded once per capability and scope during a visit.
A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials.
credentials: 'include',
reason?: string |undefined
reason: 'Load your profile from your existing session',
The guided demo below embeds Wikipedia, restyles it, reads the heading, fills a search, and clicks Search. It uses an isolated cloud session with no install. If the FKN extension is already exposed, it uses the extension instead and asks once for the three sensitive actions.