*** id: d75e68e2-c60e-456c-a2b8-8128ab9db53a 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 Object containing the parameters of the method. 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 import { SignalWire } from "@signalwire/realtime-api"; const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" }) const chatClient = client.chat; await chatClient.publish({ channel: "my-channel", content: "Hello, world." }); ``` Publishing a message as an object: ```js import { SignalWire } from "@signalwire/realtime-api"; const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" }) const chatClient = client.chat; await chatClient.publish({ channel: "my-channel", content: { field_one: "value_one", field_two: "value_two" } }); ```