> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nanoforge.eu/llms.txt
> Use this file to discover all available pages before exploring further.

# connect

> Initiate a WebSocket connection to the server.

import { PageLink } from '/snippets/tsdocs/PageLink.jsx';
import { RefLink } from '/snippets/tsdocs/RefLink.jsx';

# connect

## Summary

Initiate a WebSocket connection to the server.

## Signature

```typescript theme={null}
connect(): Promise<void>;
```

## Parameters

*No parameters.*

## Returns

**Type**:`Promise<void>`

Initiate a WebSocket connection to the server.

## Remarks

Connects to `ws[s]://<ip>:<port>`. Resolves as soon as the connection attempt is dispatched (the socket may not be fully open yet — check `isConnected`).
