OptionalchannelThe channel; also locates the chat's region.
OptionalchannelsThe feeds to subscribe to; chatChannels(chatroomId, channelId) by
default. The first is taken for the chat feed: its subscribe resets the
reconnect backoff (with none listed, Kick accepting the connection does).
A feed listed twice is subscribed and reported once.
The chatroom (website API chatroom.id).
OptionalcreateOpens the socket yourself, instead of WebSocket.
OptionalendpointsKick's URLs to use instead; a key left out or undefined stays Kick's.
OptionalfetchThe fetch to make Kick's requests with. Default: the global fetch.
Optionalinit: RequestInitOptionalnowThe session's clock, ms, only ever going forward. Default:
performance.now(). A reading that is not a number from 0 to
Number.MAX_SAFE_INTEGER (or a throw) is reported to onError once,
and connectChat carries on with performance.now().
OptionalonA connection, or an attempt at one, ended; another follows after drop.waitMs.
OptionalonA callback above threw, or now gave a reading it cannot use. Default:
console.error. The connection carries on either way.
OptionalonThe connection or its subscriptions changed.
OptionaltimeoutHow long a request, or the WebSocket handshake, may take, ms: above 0 and at most 2147483647 (setTimeout's limit; there is no "no timeout"). Default 10000. Out of range, or not a number: connectChat throws a RangeError.
OptionalWebThe WebSocket class, where the runtime has none (Node before 22: pass the
ws package's). Default: the global WebSocket.
connectChat's options. Every optional one may be left out or given as undefined (as a
Partial<>or optional config carries it), with the same meaning.