<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@workgrid/client](./client.md) &gt; [WsClient](./client.wsclient.md) &gt; [subscribe](./client.wsclient.subscribe.md)

## WsClient.subscribe() method

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
> 

Listen to events for the given trigger

<b>Signature:</b>

```typescript
subscribe(connect: {
        spaceId: string;
    }, trigger: string, callback: (...args: unknown[]) => void): () => EventEmitter;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  connect | { spaceId: string; } | The connect options |
|  trigger | string | The event name |
|  callback | (...args: unknown\[\]) =&gt; void | The event listener |

<b>Returns:</b>

() =&gt; EventEmitter

An unsubscribe method

