ChannelOptions
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
M extends MessageMap |
Properties
Section titled “Properties”optional kind?: PeerKind;What this client announces itself as. Defaults to ‘worker’ when there is no document, else ‘tab’.
Inherited from
Section titled “Inherited from”onInvalid?
Section titled “onInvalid?”readonly optional onInvalid?: OnInvalid;Observe validation failures instead of the default development warning.
Inherited from
Section titled “Inherited from”schema?
Section titled “schema?”readonly optional schema?: SchemaMap<M>;Validate payloads against a Standard Schema
before trusting them — any Zod, Valibot or ArkType schema, or anything else
exposing ~standard.
Without this, an inbound payload is cast, not checked: a peer running last week’s deploy sends whatever that build thought the shape was, and the receiving code reads it as whatever this build’s types say. That is the one place in this library where a type is a hope rather than a guarantee, and a rolling deploy is what turns it into a bug.
Validation runs in both directions. Inbound, a failure drops the payload — the same choice the envelope makes for a wire it cannot read. Outbound, it throws, because a value your own code just produced and cannot describe is a bug in this tab, and finding it here beats finding it in someone else’s.
Inherited from
Section titled “Inherited from”transport?
Section titled “transport?”optional transport?: (name) => Transport;Transport factory, mainly for tests. Defaults to defaultTransport.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
name | string |