ConnectRelayPublisherOptions
Defined in: relay-sdks/ts/src/publish.ts:42
Options for connectRelayPublisher: the shared connection options plus the namespace. There is no request deadline; each track’s writeTimeoutMs bounds waiting for demand and writing.
Extends
Section titled “Extends”Properties
Section titled “Properties”connectTimeoutMs?
Section titled “connectTimeoutMs?”connectTimeoutMs?: number;Defined in: relay-sdks/ts/src/connect-session.ts:87
Deadline for token resolution, transport connection, and protocol SETUP. Default 10 seconds, maximum 2147483647.
Inherited from
Section titled “Inherited from”ConnectRelayOptions.connectTimeoutMs
createTransport?
Section titled “createTransport?”createTransport?: RelayTransportFactory;Defined in: relay-sdks/ts/src/connect-session.ts:93
Create the transport. Defaults to the browser’s WebTransport; a runtime without it, or whose
WebTransport cannot negotiate protocols, fails with TRANSPORT_UNAVAILABLE unless this is
supplied.
Inherited from
Section titled “Inherited from”ConnectRelayOptions.createTransport
getToken?
Section titled “getToken?”getToken?: () => | string | RelayCredential | Promise< | string | RelayCredential | undefined> | undefined;Defined in: relay-sdks/ts/src/connect-session.ts:83
Resolve a connection token. Relay carries it in the endpoint’s jwt query parameter.
An explicit jwt in the URL wins, and the provider is not called in that case. An empty jwt
in the URL is a RangeError, raised before the provider or the transport is used. Return a
RelayCredential to say when the token expires; for a bare token the connection reads
the JWT’s exp claim, without verifying it. The provider runs once per connection: a live
session keeps the token it connected with until the relay ends it at that expiry.
Returns
Section titled “Returns”| string
| RelayCredential
| Promise<
| string
| RelayCredential
| undefined>
| undefined
Inherited from
Section titled “Inherited from”namespace
Section titled “namespace”namespace: readonly string[];Defined in: relay-sdks/ts/src/publish.ts:44
One namespace per publisher connection. Register any number of tracks within it.
signal?
Section titled “signal?”signal?: AbortSignal;Defined in: relay-sdks/ts/src/connect-session.ts:85
Aborting closes the connection, including after the connect call has resolved.
Inherited from
Section titled “Inherited from”url?: string;Defined in: relay-sdks/ts/src/connect-session.ts:74
Relay’s HTTPS WebTransport endpoint, including any endpoint path. Left out, the connection dials
DEFAULT_ENDPOINT rooted at the token’s root claim, read without verifying the token: the URL roomEndpoint
builds from that root. getToken is then required, and a token that names no usable root is a TypeError or
RangeError before the transport is used. Pass url for another relay, region or room.