*** id: 4b959b62-4a23-46fb-9a5b-4a798e832939 title: publish slug: /node/reference/pubsub/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. | | `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 pubSubClient.publish({ channel: "my-channel", content: "Hello, world.", }); ``` Publishing a message as an object: ```js await pubSubClient.publish({ channel: "my-channel", content: { field_one: "value_one", field_two: "value_two", }, }); ```