*** id: a51dc21e-c22c-4186-8107-ec0399c1d425 title: publish slug: /js/reference/chat/client/publish max-toc-depth: 3 ---------------- * **publish**(`params`): `Promise` Publish a message into the specified channel. ## Parameters Configuration object for publishing a message Channel in which to send the message. The message to send. This can be any JSON-serializable object or value. 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", }, }); ```