--- title: "Publish Data" url: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/publish-data/ description: "This page describes the method to publish real-time data to a Data Streams channel in your Node.js application with sample code snippets." last_updated: 2026-08-13T11:41:55Z service: Cloud Scale type: general related_links: - name: "Publish Data - API" url: /en/api/code-reference/cloud-scale/data-streams/publish-data - name: "Data Streams" url: /en/cloud-scale/help/data-streams/introduction --- # Publish Data [Catalyst Data Streams](https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/introduction/) enables you to publish real-time data to a channel. Any active subscribers connected to that channel will receive the published data instantly through their WebSocket connections. The `datastreams` reference used in the code below is the [component instance](https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/get-component-instance) created earlier. ### Publish Data to a Channel You can publish data to a channel by passing the channel ID and the data payload to the `publishData()` method. You can structure the payload as needed, including fields like `type`, `data`, and `timestamp`. The promise returned here will be resolved to an object confirming the publish operation. **Parameters Used**
Parameter Name Data Type Definition
`channelId` **String** A **Mandatory** parameter. Holds the unique ID of the channel.
`data` **Object** A **Mandatory** parameter. Holds the data payload to be published to the channel.
```javascript //Publish data to all subscribers of the channel const publishRes = await datastreams.publishData(CRICKET_CHANNEL_ID, { type: "cricket_score_update", data: mockCricketData, timestamp: new Date().toISOString() }); ```