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

> **SubscribeOptions** = `object`

Parameters for [subscribing](../classes/MOQtailClient.md#subscribe) to a track's live objects.

## Examples

**From the next object**

```ts
await client.subscribe({
  fullTrackName,
  priority: 0,
  groupOrder: GroupOrder.Original,
  forward: true,
  locationFilter: new LocationFilter(LocationFilterType.NextObject)
})
```

**Groups 100 through 120**

```ts
await client.subscribe({
  fullTrackName,
  priority: 32,
  groupOrder: GroupOrder.Original,
  forward: true,
  locationFilter: new LocationFilter(LocationFilterType.AbsoluteStartGroupEnd, 100n, 0n, 120n)
})
```

**From the next object, filling the current group from its start**

```ts
await client.subscribe({
  fullTrackName,
  priority: 0,
  groupOrder: GroupOrder.Original,
  locationFilter: new LocationFilter(LocationFilterType.NextObject),
  parameters: [new FillParameters([new LocationFilter(LocationFilterType.RelativeStart, 1n)])]
})
```

## Properties

### earlyDiscardPolicy?

> `optional` **earlyDiscardPolicy?**: [`EarlyDiscardPolicyConfig`](EarlyDiscardPolicyConfig.md)

Per-subscription early discard policy. Overrides the client-level default set via [MOQtailClient.setEarlyDiscardPolicy](../classes/MOQtailClient.md#setearlydiscardpolicy).

***

### forward?

> `optional` **forward?**: `boolean`

If present, forward parameter (0x10) is sent with the provided value

***

### fullTrackName

> **fullTrackName**: [`FullTrackName`](../../model/classes/FullTrackName.md)

Fully qualified track identifier ([FullTrackName](../../model/classes/FullTrackName.md)).

***

### groupOrder

> **groupOrder**: [`GroupOrder`](../../model/enumerations/GroupOrder.md)

Desired `GroupOrder` (e.g. `GroupOrder.Original`) specifying delivery ordering semantics.

***

### locationFilter?

> `optional` **locationFilter?**: [`LocationFilter`](../../model/classes/LocationFilter.md)

The [LocationFilter](../../model/classes/LocationFilter.md) selecting which Objects to deliver. Omitted, the subscription is unfiltered.

***

### onEndOfRange?

> `optional` **onEndOfRange?**: [`EndOfRangeHandler`](EndOfRangeHandler.md)

Called for each End of Range marker on the subscription's fill fetch streams.

***

### ordering?

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

Orders this subscription's objects, its fill included. Overrides [MOQtailClientOptions.ordering](MOQtailClientOptions.md#ordering).

***

### parameters?

> `optional` **parameters?**: [`MessageParameter`](../../model/type-aliases/MessageParameter.md)\[]

Optional extension parameters appended to the SUBSCRIBE control message. A
FILL_PARAMETERS here also retrieves already-published Objects on a fill fetch stream.

***

### priority

> **priority**: `number`

Subscriber priority (0 = highest, 255 = lowest). Values outside range are clamped. Fractional values are rounded.
