Type Alias SwConfig
assets?: AssetMode;
beacons: string[];
clientTag: string;
collectors?: CollectorConfig[];
datasetShare?: number;
lease?: number;
live?: { mode: "adaptive" | "always"; public: boolean; socket?: true };
logout?: string[];
manifest?: string;
mode?: Mode;
pack?: StubPack;
policy?: [string, string][];
principalDatasets?: { maxStaleMs: number; name: string }[];
protocol: typeof PROTOCOL_VERSION;
provision?: ProvisionConfig;
resourceWrites?: readonly ResourceWrite[];
routes: SerializedRoute[];
runtime?: string;
shadowSample?: number;
stamp?: number;
templates: Record<string, CompiledTemplate>;
thirdParty?: ThirdPartyConfig;
version: string;
views?: boolean;
writes?: WriteConfig[];
}
Properties
Optionalassets
how same-origin subresources are handled; cache when absent
beacons
same-origin POST paths the worker queues and flushes in one request
client Tag
the exact script tag the server injects, so a local render matches a network one
Optionalcollectors
cross-origin analytics collectors the worker holds and delivers later
Optionaldataset Share
The share, above 0 and at most 1, of the storage headroom one dataset may use. The worker refuses a seed whose rows would use more; 1 when absent.
Optionallease
seconds the browser may hold the worker script: the lease after which the page checks it again
Optionallive
Present while the server answers /.spool/live. public is true when the stream also carries
public freshness, so the worker treats its public replica as current while a lease is open.
mode is always when the page opens the stream whenever it is visible, and adaptive when the
worker asks for it at the second lease renewal of a page's visible session. socket is true
when the hub also accepts a WebSocket upgrade at the same path; a page then opens a socket
and falls back to server-sent events if the upgrade fails.
Optionallogout
same-origin paths whose request ends the session: the worker wipes the principal store first
Optionalmanifest
The URL of a spool.json. Present, the worker has no spool server: it takes its routes from
that file, checks it for changes in place of /.spool/sync, and sends no request to /.spool/*.
Optionalmode
the mode for routes that do not name one; serve when absent
Optionalpack
the pack the script carries, when the server holds one for its current version
Optionalpolicy
the site's security headers, as name and value pairs, for a worker that holds no site policy yet
Optionalprincipal Datasets
the principal datasets and how long each may answer after its last confirmed sync; absent while the flag is off
protocol
Optionalprovision
what the worker assumes before telemetry says otherwise, and which pages to warm
Optionalresource Writes
the resource writes a request is sent to the server for, each applied from its Spool-Delta
routes
Optionalruntime
the hash of the worker's own code; a different one empties the replica, a content version does not
Optionalshadow Sample
the share of views, 0 to 1, that run in shadow while the mode is serve; 0 when absent
Optionalstamp
The operator's counter for the stub. Its bytes change when the stamp does, so a static host that republishes each lease period makes a forced check install a new script, and the install is a contact.
templates
compiled templates keyed by route pattern
Optionalthird Party
the opt-in cache for versioned cross-origin files
version
Optionalviews
whether the worker queues a spool.view per page view; true when absent
Optionalwrites
the declared write classes; absent while declared writes are off, which is the default
what the server compiles into the worker script: routes, templates and the tag to inject