# Client

## Content

# Class: Client

Represents a collaboration client for bidirectional communication with the server.

## Table of contents

### Constructors

- [constructor](Client#constructor)

### Accessors

- [url](Client#url)

### Methods

- [connect](Client#connect)

## Constructors

### <a id="constructor" name="constructor"></a> constructor

• **new Client**(`url?`, `options?`)

Creates a new collaboration client instance.

#### Parameters

| Name | Type |
| :------ | :------ |
| `url?` | `string` |
| `options?` | [`IClientOptions`](../interfaces/IClientOptions) |

## Accessors

### <a id="url" name="url"></a> url

• `get` **url**(): `string`

Retrieves the server URL of the client.

#### Returns

`string`

## Methods

### <a id="connect" name="connect"></a> connect

▸ **connect**(`roomId`, `options?`): [`Connection`](Connection)

Establishes a connection to a specified room.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `roomId` | `string` | The ID of the room to connect to. |
| `options?` | [`IConnectOptions`](../interfaces/IConnectOptions) | - |

#### Returns

[`Connection`](Connection)

- A new connection instance.
