# ConnectRelayPublisherOptions

URL: https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelaypublisheroptions/

Defined in: [relay-sdks/ts/src/publish.ts:42](https://github.com/caprids/relay-sdks/blob/main/ts/src/publish.ts#L42)

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

- [`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/)

## Properties

### connectTimeoutMs?

```ts
connectTimeoutMs?: number;
```

Defined in: [relay-sdks/ts/src/connect-session.ts:87](https://github.com/caprids/relay-sdks/blob/main/ts/src/connect-session.ts#L87)

Deadline for token resolution, transport connection, and protocol SETUP. Default 10 seconds, maximum 2147483647.

#### Inherited from

[`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/).[`connectTimeoutMs`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/#connecttimeoutms)

***

### createTransport?

```ts
createTransport?: RelayTransportFactory;
```

Defined in: [relay-sdks/ts/src/connect-session.ts:93](https://github.com/caprids/relay-sdks/blob/main/ts/src/connect-session.ts#L93)

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

[`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/).[`createTransport`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/#createtransport)

***

### getToken?

```ts
getToken?: () => 
  | string
  | RelayCredential
  | Promise<
  | string
  | RelayCredential
  | undefined>
  | undefined;
```

Defined in: [relay-sdks/ts/src/connect-session.ts:83](https://github.com/caprids/relay-sdks/blob/main/ts/src/connect-session.ts#L83)

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](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/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

  \| `string`
  \| [`RelayCredential`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/relaycredential/)
  \| `Promise`\<
  \| `string`
  \| [`RelayCredential`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/relaycredential/)
  \| `undefined`\>
  \| `undefined`

#### Inherited from

[`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/).[`getToken`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/#gettoken)

***

### namespace

```ts
namespace: readonly string[];
```

Defined in: [relay-sdks/ts/src/publish.ts:44](https://github.com/caprids/relay-sdks/blob/main/ts/src/publish.ts#L44)

One namespace per publisher connection. Register any number of tracks within it.

***

### signal?

```ts
signal?: AbortSignal;
```

Defined in: [relay-sdks/ts/src/connect-session.ts:85](https://github.com/caprids/relay-sdks/blob/main/ts/src/connect-session.ts#L85)

Aborting closes the connection, including after the connect call has resolved.

#### Inherited from

[`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/).[`signal`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/#signal)

***

### url?

```ts
url?: string;
```

Defined in: [relay-sdks/ts/src/connect-session.ts:74](https://github.com/caprids/relay-sdks/blob/main/ts/src/connect-session.ts#L74)

Relay's HTTPS WebTransport endpoint, including any endpoint path. Left out, the connection dials
[DEFAULT\_ENDPOINT](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/variables/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.

#### Inherited from

[`ConnectRelayOptions`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/).[`url`](https://www.caprid.com/docs/reference/typescript/caprid/relay/index/interfaces/connectrelayoptions/#url)
