---
url: https://docs.moqtail.dev/ts/api/client/type-aliases/MOQtailClientOptions.md
---
# Type Alias: MOQtailClientOptions

> **MOQtailClientOptions** = `object`

Options for the [MOQtailClient](../classes/MOQtailClient.md) constructor: connection target, protocol
negotiation, and timeouts. Nothing happens on the network until
[MOQtailClient.init](../classes/MOQtailClient.md#init).

## Example

```ts
const client = new MOQtailClient({
  url: relayUrl,
  dataStreamTimeoutMs: 5000,
  controlStreamTimeoutMs: 1500,
})
client.on('sessionterminated', (r) => console.warn('terminated', r))
await client.init()
```

## Properties

### controlStreamTimeoutMs?

> `optional` **controlStreamTimeoutMs?**: `number`

Control stream read timeout in milliseconds.

***

### dataStreamTimeoutMs?

> `optional` **dataStreamTimeoutMs?**: `number`

Per *data* uni-stream idle timeout in milliseconds.

***

### enableDatagrams?

> `optional` **enableDatagrams?**: `boolean`

If true, enables datagram support for the session.

***

### fillOpenTimeoutMs?

> `optional` **fillOpenTimeoutMs?**: `number`

How long after SUBSCRIBE_OK a fill fetch stream may take to open before ordering
stops waiting for it, in milliseconds. Defaults to [DEFAULT_FILL_OPEN_TIMEOUT_MS](../variables/DEFAULT_FILL_OPEN_TIMEOUT_MS.md).

A fill that opens later still orders against what is held, but its objects at or
before what was already released come late (`flush`) or are dropped (`drop`), and no
`orderinggap` reports them. Raise it on paths whose RTT nears it.

***

### ordering?

> `optional` **ordering?**: [`ObjectOrdering`](../interfaces/ObjectOrdering.md) | `"none"`

The default [ObjectOrdering](../interfaces/ObjectOrdering.md) of the session's subscriptions and fetches. Without one, objects pass through unordered.

***

### setupOptions?

> `optional` **setupOptions?**: [`SetupOptions`](../../model/classes/SetupOptions.md)

[SetupOptions](../../model/classes/SetupOptions.md) customizations; if omitted a default instance is built.

***

### switchDrainTimeoutMs?

> `optional` **switchDrainTimeoutMs?**: `number`

How long a track a soft switch handed over from may stay quiet before it is
retired anyway, in milliseconds. Defaults to
[DEFAULT_SWITCH_DRAIN_TIMEOUT_MS](../variables/DEFAULT_SWITCH_DRAIN_TIMEOUT_MS.md).

***

### trackAliasResolutionTimeoutMs?

> `optional` **trackAliasResolutionTimeoutMs?**: `number`

How long a data stream waits for the control message that establishes its track
alias before the stream is abandoned, in milliseconds. Defaults to
[DEFAULT_TRACK_ALIAS_RESOLUTION_TIMEOUT_MS](../variables/DEFAULT_TRACK_ALIAS_RESOLUTION_TIMEOUT_MS.md).

***

### transportOptions?

> `optional` **transportOptions?**: `WebTransportOptions` & `object`

Passed directly to the browser's [WebTransport](https://developer.mozilla.org/docs/Web/API/WebTransport) constructor for [WebTransportOptions](https://developer.mozilla.org/docs/Web/API/WebTransportOptions).

#### Type Declaration

##### protocols?

> `optional` **protocols?**: `string`\[]

***

### url

> **url**: `string` | `URL`

Relay / server endpoint for the underlying [WebTransport](https://developer.mozilla.org/docs/Web/API/WebTransport) session (can be absolute [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) or string).
