---
url: https://docs.moqtail.dev/ts/api/model/classes/Setup.md
---
# Class: Setup

The first message each endpoint sends on its control stream.

Both peers send the same message; there are no separate client and server forms and
no version fields, since version negotiation happens over ALPN.

Some options are client-only (see [SetupOptionType](../enumerations/SetupOptionType.md)); whether a peer is
allowed to send a given option depends on which side it is and on the transport,
neither of which is knowable here, so that rule is enforced by the caller rather than
by this class.

## Constructors

### Constructor

> **new Setup**(`setupOptions`): `Setup`

#### Parameters

##### setupOptions

[`KeyValuePair`](KeyValuePair.md)\[]

#### Returns

`Setup`

## Properties

### setupOptions

> `readonly` **setupOptions**: [`KeyValuePair`](KeyValuePair.md)\[]

## Methods

### getType()

> **getType**(): [`ControlMessageType`](../enumerations/ControlMessageType.md)

#### Returns

[`ControlMessageType`](../enumerations/ControlMessageType.md)

***

### serialize()

> **serialize**(): [`FrozenByteBuffer`](FrozenByteBuffer.md)

#### Returns

[`FrozenByteBuffer`](FrozenByteBuffer.md)

***

### parsePayload()

> `static` **parsePayload**(`buf`): `Setup`

#### Parameters

##### buf

[`BaseByteBuffer`](BaseByteBuffer.md)

#### Returns

`Setup`
