# Function: createWSClient()

> 

> **createWSClient**(`opts`): `WsClient`

Defined in: packages/client/dist/wsLink-Cjetil1Z.d.mts:282

Opens and manages a WebSocket connection to a tRPC server. Pass it to
`wsLink`.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `opts` | [`WebSocketClientOptions`](https://trpc.io/docs/typedoc/react-query/index/interfaces/WebSocketClientOptions.md) |

## Returns

`WsClient`

## See

https://trpc.io/docs/client/links/wsLink#wslink--createwsclient-options
