Browser-Side API

Lookup tables for the browser side: connectDevframe options, RPC client events, connection statuses, and in-page channel error codes.

Lookup tables for a devframe's browser side. Each section links the guide page that teaches the concept.

connectDevframe options

The options of connectDevframe() / getDevframeRpcClient()Client.

OptionDescription
connectionConnection prepared by setupDevframeConnection().
baseURLMount path to probe for __connection.json (array = fallback). Default './' (relative to document.baseURI); use an absolute path ('/__devframe/') from outside the SPA.
authTokenOverride the auth token (default: a locally-persisted id).
cacheOptionstrue for default caching, or an options object.
callTimeoutMs before a pending rpc.call rejects with a 'timeout' DevframeConnectionError; 0/omit = wait forever.
wsOptionsTransport overrides — onConnected / onError / onDisconnected hooks, socket URL.
rpcOptionsForwarded to birpc.
connectionMetaDescriptor that skips the __connection.json fetch.

RPC client events

Emitted over rpc.eventsEvents.

EventFires when
rpc:is-trusted:updatedTrust granted, denied, or revoked. Carries the new isTrusted boolean.
connection:statusThe connection status changes. Carries (status, previous).
connection:errorA connection-level failure — socket error or trust refused. Carries the Error.
rpc:errorAn rpc.call rejects, from the node side or a down connection. Carries (error, method).

Connection statuses

The values of rpc.statusHandling connection and auth errors.

StatusMeaning
connectingEstablishing socket / handshake. Calls queue until open.
connectedSocket open and trusted; calls are served.
unauthorizedSocket open, trust refused. Prompt for authentication.
disconnectedSocket closed (dropped mid-session or never opened).
errorFatal — the socket errored or connection meta couldn't load.

In-page channel error codes

The error.code values of InPageChannelErrorErrors and fallbacks.

CodeWhenWhat to do
timeoutA call outlived callTimeoutMs (default 15s), or whenConnected(ms) expiredThe message carries the endpoint status — connecting usually means the page script isn't loaded in this context
closedThe endpoint was closed with calls pendingExpected during teardown
not-serializableA jsonSerializable: true payload contained a non-JSON valueThe message names the offending path (e.g. its arguments[0].nodes[2] is a Map)
not-cloneableThe port refused to clone a payload (DataCloneError)Strip functions/DOM nodes/reactivity proxies — or declare jsonSerializable: true for the precise error above
invalid-argsIncoming arguments failed their Standard-Schema validationThe message lists the schema issues
state-uninitializedThe page script read a shared state before providing its initialValueInitialize on first access