*** id: c3d27caa-8f8d-4fdd-a22b-000047934fb6 title: publish slug: /node/reference/chat/client/publish description: publish method for the Client class. max-toc-depth: 3 ---------------- ### publish * **publish**(`params`): `Promise` Publish a message into the specified channel. #### Parameters | Name | Type | Description | | :--------------- | :----------------- | :------------------------------------------------------------------------------------------ | | `params` | `Object` | - | | `params.channel` | `string` | Channel in which to send the message. | | `params.content` | `any` | The message to send. This can be any JSON-serializable object or value. | | `params.meta?` | `Record` | Metadata associated with the message. There are no requirements on the content of metadata. | #### Returns `Promise` #### Examples Publishing a message as a string: ```js await chatClient.publish({ channel: "my-channel", content: "Hello, world." }); ``` Publishing a message as an object: ```js await chatClient.publish({ channel: "my-channel", content: { field_one: "value_one", field_two: "value_two" }, }); ```