<!-- 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; [publish](./client.wsclient.publish.md)

## WsClient.publish() 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.
> 

Publish an event

<b>Signature:</b>

```typescript
publish(connect: {
        spaceId: string;
    }, type: string, data?: unknown): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  connect | { spaceId: string; } | The connect options |
|  type | string | The event type |
|  data | unknown | The event payload |

<b>Returns:</b>

void

