OptionalauditOptionalauthenticateOptionalauthorizeAuthorizer for the /blobs route. When omitted it defaults to one
derived from authenticate so the blob route shares the websocket
sync token (a missing/invalid token is rejected, and PUT/DELETE
additionally require write capability). With the anonymous default
authenticate, blob access stays anonymous — matching the WS path.
Pass null to explicitly disable blob authorization.
OptionalauthorizeRegistry authorizer override. The default adapts authenticate with a
pseudo-room, which room-BOUND token schemes can never satisfy — those
deployments supply their own (see createRoomTokenRegistryAuthorizer).
null disables auth (anonymous registry).
OptionalblobReject blob PUTs above this size (default 100 MB).
OptionalblobPluggable blob storage for the /blobs/... route. Default:
in-memory. Pass a custom ServerBlobStorage to back with S3 or
filesystem in production.
OptionalcompactOptionalcorsCross-origin access for the HTTP routes. Default: enabled with origin
reflection (permissive). Pass an allow-list to restrict, or false to
disable entirely (e.g. when a reverse proxy owns CORS). Only applies to
the server this function creates — ignored when you pass your own
server.
OptionalhostOptionalidleUnload rooms that have had zero peers for this many ms (default disabled). Persistence keeps the durable copy; rehydrate on next connect.
OptionalkeepaliveApplication-level keepalive period in ms (default 15s). Exposed so tests
can observe the keepalive without waiting on the real cadence; production
callers should leave it alone. See Room.sendKeepalive.
OptionalkickEnable the POST /collab/kick route so an admin can force-disconnect a
peer by awareness clientId. The server binds the kick to its room manager;
only the verifying secret is supplied here. Omit to disable (404).
OptionallayerMount the layer-registry routes (/api/v1/layers|refs|reviews,
10-registry.md): push/pull content-addressed layers, refs with
server-side merge-policy enforcement, and review objects. Off by
default. Pass true for an in-memory registry, or supply a store.
Authorization derives from authenticate exactly like the blob
route: any authenticated principal may read, writes require write
capability, and the principal's userId becomes the acting resolver
for merges and waivers.
OptionalmaxOptionalmetricsMetrics registry to publish at /metrics. Defaults to the package singleton.
OptionalmetricsRequire a bearer token (compared against this shared secret) for the
/metrics diagnostics endpoint, which labels gauges with raw room
IDs. /healthz stays open for liveness probes but omits room detail
unless this token is presented. Defaults to COLLAB_METRICS_TOKEN.
OptionalpersistenceOptionalportOptionalratePer-peer rate limit. Function form lets you tune by role/user.
OptionalreleaseEnable POST /collab/release (hand back an unused fresh-room claim). Omit to disable (404).
OptionalrevokeEnable the POST /collab/revoke route so an admin can invalidate a share
link (its jti is added to a deny-list the authenticator's isRevoked
consults). Omit to leave the route disabled (404).
OptionaltokenEnable the POST /collab/token mint route for link-based sharing.
Omit to leave the route disabled (404). Pair with
authenticate: createRoomTokenAuthenticator({ secret }) so connections
are verified against the same secret.
OptionalverifyOptional per-message verifier (anti-replay HMAC etc.). Runs before
rate limit / role check. Returning { ok: false } audits as
reject with the reason and drops the message.
Append-only audit sink. Default: drop all events.