# Data Streams -------------------------------------------------------------------------------- title: "" last_updated: "2026-10-08T06:47:52.524Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/use-cases/" -------------------------------------------------------------------------------- <!-- --- title: "Use Cases" page_type: "home" service: "Cloud Scale" description: "Real-world use cases for Data Streams including event-driven streaming, serverless functions, lead distribution, retail synchronization, and mobile devices." tags: ["Use Cases", "Real-time Streaming", "Event-Driven", "Signals Integration"] type: "general" parent_path: "/en/cloud-scale/help/" weight: 3 name: "Data Streams" --- # Use Cases Data Streams can be used for a variety of real-time streaming scenarios in your Catalyst applications. The following are some common use cases of Data Streams: ## Event-Driven Streaming with Catalyst Signals [Catalyst Signals](http://link) can be used to automatically publish application or system events to a Data Streams channel. When events such as a row insertion in Data Store, a user signup in Authentication, or a record update in Zoho CRM occur in connected services, Signals can route these events to a Data Streams channel through rules and targets. All subscribers connected to the channel then receive the event data in real time, without requiring any manual publishing logic. This enables you to build fully event-driven streaming architectures where data flows automatically from source services to subscriber applications. Refer to the [Publishing Methods](http://link) section to learn more about configuring Signals as a publishing trigger. ## Serverless Functions as Publishers [Catalyst Serverless Functions](http://link) can be used to publish events to a Data Streams channel after executing business logic. For example, when an [Advanced I/O function](http://link) processes an order request, generates a report, or completes a background task, it can call the `publishData()` method (or `publish_data()` in Python) to stream the result to a channel. Multiple subscribers, such as monitoring dashboards, notification services, or analytics pipelines, can then receive these updates instantly. This approach is ideal for scenarios where your backend service generates the data to be streamed, and multiple downstream consumers need to react to it in real time. Refer to the [Quick Start Guide](http://link) for step-by-step publishing instructions. ## Real-Time Lead Distribution Lead assignment systems that rely on external decision engines or business logic services can use Data Streams to distribute leads in real time. When a new lead enters the system, it can be published as an event to a Data Streams channel and processed by external logic systems that determine the appropriate sales representative. Because Data Streams delivers messages sequentially and requires each message to be acknowledged before the next one is delivered, the lead distribution process is handled reliably and in order. ## Retail and Point-of-Sale Synchronization Retail systems operating across multiple branches or point-of-sale devices can use Data Streams to synchronize updates such as customer profiles, loyalty points, pricing information, or promotions. When data changes in one location, the update can be published to a Data Streams channel and streamed to all connected systems, ensuring that every branch operates with the latest information. This eliminates the need for periodic polling or batch synchronization and enables all connected endpoints to receive changes as they occur. ## Mobile and Intermittently Connected Devices Mobile or intermittently connected devices can subscribe to Data Streams channels and receive events while they have network connectivity. If a device temporarily loses its connection, it can reconnect and resume the stream using the `'-2'` (resume) subscribe type to receive all events that were published during the disconnection period. This ensures that mobile clients remain synchronized with backend systems even in unstable network environments. Note: The resume capability is subject to the channel's 48-hour data retention period. Events older than 48 hours are no longer available. Refer to the Data Retention section for more details. Data Streams can also be implemented in the following types of applications: * Live dashboards and analytics platforms * Chat and messaging applications * Notification and alerting systems * IoT device communication and telemetry * Collaborative editing and real-time document updates --> -------------------------------------------------------------------------------- title: "Introduction" description: "Data Streams enables real-time, event-driven data streaming from publishers to subscribers through channels using the Publish-Subscribe model with WebSocket connections." last_updated: "2026-10-08T06:47:52.524Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/introduction/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Introduction Data Streams is a Catalyst service that enables you to stream real-time, event-driven data from a [publisher](#publisher) to its [subscribers](#subscriber) through a [channel](#channel). It follows a publish-subscribe (pub/sub) model, where publishers send data to a channel and subscribers receive the data from that channel in real time over WebSocket connections. Unlike traditional HTTP requests, WebSocket connections remain persistently open once established rather than creating a new connection for every request-response cycle. This enables data to be pushed automatically to all connected subscribers as new events occur, eliminating the need for repeated server polling. Developers can utilize Data Streams to build real-time features such as live dashboards, chat applications, notification systems, and more without implementing custom messaging infrastructure. <!-- Refer to the Use Cases section to learn different ways to utilize Data Streams. --> You can create and manage multiple channels from the Catalyst console based on your application needs. Once a channel is created, publishers can send data to the channel using the Catalyst SDK (Java, JavaScript, Python), REST API, or Signals, and subscribers can connect to the same channel over a WebSocket connection to receive the published data in real time. ## Components of Data Streams ### Publisher A Publisher, also referred to as a data producer, is any application, service, or component that sends data to a Data Streams channel. Publishers can publish data to a channel using the SDK or API offerings. Multiple publishers can send data to the same channel. Catalyst services, such as Serverless Functions and AppSail, or any other third-party services that produce live data can be considered as Publishers. Signals, a Catalyst service, can also be a data producer because it can collect events from Zoho and other external services and stream them to a channel. Learn more about different publishing methods. Note: Publishers don't require WebSocket connections to publish data; they can push data using SDKs or APIs. Only Subscribers require WebSocket connections to receive the streamed data. ### Channel Channel are the core communication layer in Data Streams. They receive data from publishers and distribute it to all subscribers connected to that channel. Channels can be created in the console, and each channel is identified by its channel name and unique channel ID. These attributes are used by both publishers and subscribers to publish or receive streamed data. Learn more about Channels and their configurations. Note: Publishers can stream data to a channel even if there are no active subscribers connected to it. ### Subscriber A subscriber is a service that receives streamed data from a Data Streams channel through a WebSocket connection. There can be multiple subscribers subscribed to a single channel, and each subscriber will receive the published data in real-time. To establish a WebSocket connection, a subscriber requires a token pair for authentication. Once connected, you need to choose a subscriber type to determine the data it needs to receive, such as only live events, all available events from the earliest point, or a resumption from where the subscriber previously left off. Each message received by a subscriber must be acknowledged before the next message is delivered. Subscribers will continue to receive data as long as they remain connected to the channel. If a subscriber disconnects, it can reconnect and resume receiving data from its last acknowledged position by using the appropriate subscriber type. ## Data Streams Architecture Data Streams is made up of Publishers (data producers) that send data to a channel, and subscribers that receive the data from that channel in real time. The channel acts as a persistent communication layer that receives the published data and distributes it to all subscribers connected to it. Publishers can be applications, back-end services, or external systems that generate events such as: * CRM updates on Leads or Deals * Changes made to the Contact record * Live chat messages * Notifications regarding payment statuses * Updates to order statuses * Updates to sports scores In the Catalyst console under Test Data Flow, you will be able to view a preview of the published data. Subscribers are clients or servers that consume this streamed data. These can include: * Mobile or web clients * Backend services * Notification systems * Analytics dashboards * IoT devices * Microservices The following diagram illustrates Data Streams' underlying architecture: This architecture enables low-latency event streaming without requiring clients to constantly poll the server for updates. Catalyst offers REST APIs support, and SDKs for Data Streams in the following runtimes: * Java SDK * JavaScript SDK * Python SDK -------------------------------------------------------------------------------- title: "Key Concepts" description: "Foundational concepts for Data Streams including publishing methods, subscriber types, tokens, acknowledgement, and message event structure." last_updated: "2026-10-08T06:47:52.524Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/key-concepts/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Key Concepts This section covers the foundational concepts you need to understand before working with Data Streams. Get familiar with these concepts; they're referenced throughout the component, and its related documentation. ## Publishing Methods Data published to a Data Streams channel using any of the following methods is distributed to all connected subscribers in real time. ### Catalyst SDK The Data Streams SDK offers publishData() (or publish_data() in Python) method, which accepts channel ID and the required data as inputs. The data is then sent to the channel through the SDK's REST-based interface without requiring a WebSocket connection. Using Catalyst SDK (Java, JavaScript, and Python) to publish data from a server-side function or application is ideal when your backend service or function generates the data to be streamed. For example, you could have a Catalyst Advanced I/O function that processes incoming data and publishes the results to a channel. Note: You need admin-level authentication to publish data to a channel. The Catalyst SDK (Java, JavaScript, or Python) method can only be invoked from a server-side entity. It cannot be called from a client or browser application. Learn more about publishing data across all supported runtimes. ### Data Streams REST API Using the Data Streams REST API, is preferred when your application isn't using the Catalyst SDK directly or when you need to publish data from an external system or third-party service. Refer to the API documentation. ### Catalyst Signals Catalyst Signals is an event bus service that enables event-driven communication between decoupled applications or systems. We can use this service to automatically publish data to a Data Streams channel when an events occur in connected services. For example, let's say that when a user has data to publish and signs up for your application through Authentication, you need to perform a required row insert in Catalyst Data Store, and a record update in your Zoho CRM. You can have this entire process automated with an event-driven workflow by using the Signals service. Using a configured Signals publisher, the sign-up event can be routed to a Data Streams channel through Signals Rules and Targets. The event data is then streamed to all subscribers connected to the channel. Using this method, you can build event-driven streaming architectures without manually coding publishing logic. For example: * A new order in Zoho CRM automatically streams the order details to a live dashboard. * A file upload in Catalyst Stratus triggers a notification stream to all connected clients. * A cache update in a Catalyst Cache segment streams the updated value to the applications acting as subscribers. You can use the Triggers section present in the channel dashboard to configure an integration with the Catalyst Signals service. Alternatively, you can also directly configure it in the Catalyst Signals section of the console. Note: Signals acts as an event source that triggers publishing to a Data Streams channel. Subscribers still receive the data through their WebSocket connections, regardless of whether the data was published through the SDK, API, or Signals. You need to implement the required integrations using the Signals service. Learn more about using the Catalyst Signals. ### WebSocket Connections Data Streams uses websocket connections to deliver streamed data from channels to subscribers in real time. Unlike traditional HTTP requests, where a new connection is created for every request-response cycle, a WebSocket connection remains open once established. This allows the server to push data to connected subscribers instantly whenever new events are published, without requiring clients to repeatedly poll for updates. Catalyst offers SDK support in the following runtimes to provide websocket client classes for establishing and managing subscriber connections: * Java * JavaScript * Python Learn more about creating and managing WebSocket connections. ### Token Pair A token pair is the subscribers' authentication credentials, required to create or keep open an authenticated websocket connection in a Data Streams channel. This token pair is a mandatory requirement to subscribe to a channel. Catalyst offers SDK support in the following runtimes to easily generate the required token pairs: * Java * JavaScript * Python Learn more about implementing token pairs. ## Subscriber Types A subscriber type determines how and from which point a subscriber begins receiving data from a channel. Data Streams support the following subscriber types: <table class="content-table"> <thead> <tr> <th class="w20p">Subscriber Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>'0'</td> <td>Live events only - Receive only new messages published after subscribing.</td> </tr> <tr> <td>'-1'</td> <td>Earliest available - Receive all available messages starting from the earliest stored event within the channel's retention period.<br/>Note: This type delivers events from the earliest available point within the channel's 48-hour retention period. Events older than 48 hours are no longer available.</td> </tr> <tr> <td>'-2'</td> <td>Resume - Resume from where the subscribers' last session left off. For new subscribers, this behaves the same as '0' (live events only).</td> </tr> <tr> <td>'&lt;streaming-id&gt;'</td> <td>From a specific Streaming ID - Resume from a specific Streaming ID. Messages published after this ID will be delivered.</td> </tr> </tbody> </table> Learn more about using each subscriber type. ### Message Event Structure When a subscriber receives data from a channel, the incoming message event contains the following fields: <table class="content-table"> <thead> <tr> <th class="w20p">Field</th> <th class="w15p">Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>operation</td> <td>string</td> <td>The type of event. Use this field to determine how to process the message - event for inline data or api for bulk data.</td> </tr> <tr> <td>streamingId</td> <td>string</td> <td>A unique identifier for this message in the stream.</td> </tr> <tr> <td>data</td> <td>string</td> <td>The published data, always delivered as a string. Present when operation is event (inline events).</td> </tr> <tr> <td>url</td> <td>string</td> <td>URL to fetch bulk data. Present when operation is api (bulk events).</td> </tr> <tr> <td>method</td> <td>string</td> <td>HTTP method to fetch bulk data. Present when operation is api (bulk events).</td> </tr> </tbody> </table> Example Message Event Structure: { "operation": "event", "streamingId": "16965000000027481", "data": "{\"orderId\": 12345, \"status\": \"shipped\"}" } { "operation": "api", "streamingId": "16965000000027482", "url": "https://api.catalyst.zoho.com/baas/v1/data-streams/bulk/xyz", "method": "GET" } ### Acknowledgement Data Streams delivers messages to subscribers in sequence. After receiving and processing a message event, the subscriber must send an acknowledgement to confirm that the message has been handled. Until the acknowledgement is sent, the next message in the stream will not be delivered. This mechanism ensures ordered, reliable message delivery. If a subscriber disconnects before acknowledging a message, it can reconnect using the '-2' (resume) subscribe type to continue from where it left off. Learn more about using the Acknowledgement feature. ### Connection Lifecycle The following diagram illustrates the connection lifecycle: Catalyst SDK (Java, JavaScript, and Python) offers support and manages the following lifecycle aspects automatically for subscriber connections: 1. Token Pair — Generate a token pair using the subscriber's user ID or connection name. This token pair provides the credentials required to authenticate the WebSocket connection. 2. Connection — Opens a WebSocket to the Data Streams server using the generated token pair. 3. Authentication — The server validates the token pair (Key and Session ID). If authenticated, an 'open' event is emitted and the server returns the session credentials. 4. Subscription — Your code calls the subscribe method with a subscribe type to start receiving data. 5. Data Flow — The server pushes message events. Your code processes each event and calls the acknowledgement method. 6. Disconnect or Unsubscribe — From here, you can either invoke the close method to disconnect and terminate the WebSocket connection directly, or the unsubscribe method to stop receiving data from the channel. 7. Connection Closed — After unsubscribing, the WebSocket connection is closed, ending the lifecycle. Note: Disconnecting and unsubscribing lead to different outcomes for a subscriber. If you disconnect, you can reconnect and resume using the '-2' subscribe type to continue receiving messages from where you last left off. If you unsubscribe, the connection is closed and the subscriber's session data is deleted entirely; you will need to generate a new token pair and subscribe again, starting fresh as a new subscriber. ### Data Retention Each Data Streams channel retains published data for 48 hours from the time it is published. Subscribers can reconnect within this retention period and receive events that were streamed during that time by using the appropriate subscribe type ('-1' for earliest available, '-2' for resume, or a specific streaming ID). Events older than 48 hours will not be available and cannot be retrieved. -------------------------------------------------------------------------------- title: "Channels" description: "Create, configure, and manage Data Streams channels including access control, testing data flow, and monitoring channel activity." last_updated: "2026-10-08T06:47:52.526Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/channels-overview/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Channels Channels are the communication layer between publishers and subscribers in a Data Streams workflow. Publishers send data to a channel, and subscribers receive the streamed data from that channel in real time. Channel creation and management can be performed only from the Catalyst Console. After a channel is created, publishers can send data to it using the Catalyst SDK or the REST API, and subscribers connect to it over WebSocket connections to receive the published data. Data streamed through a channel is delivered in individual messages. For every message received, the subscriber must send an acknowledgement to receive the next batch from the queue. Each message shared through the stream is assigned its own unique streaming ID. ## Channel Configuration Each channel is uniquely identified by a Channel Name and a Channel ID. - Channel Name is the user-defined name assigned when the channel is created. You can find the Channel Name in the channel header. - Channel ID is the unique ID generated by Catalyst when the channel is created. The Channel ID can be found in the channel dashboard General Details section. You will use the Channel ID when interacting with Data Streams through the SDK or API. ## Channel Operations You can perform the following operations on Data Streams channels from the Catalyst Console: ### Create a Channel Create a new Data Streams channel with access control configuration (User Roles or Custom Logic). Channels are uniquely identified by a Channel Name and Channel ID. Refer to Create a Channel for detailed steps. ### Manage Channels Update the channel name, modify access control settings, or permanently delete channels that are no longer needed. When the channel name is updated, the Channel ID remains unchanged. Refer to Manage Channels for detailed steps. ### Test Data Flow Verify channel setup by testing publishing and subscribing directly from the Catalyst Console without writing code. The Test Data Flow section allows you to simulate both a publisher and a subscriber, send sample payloads, and receive streamed data with acknowledgement workflow. Refer to Test Data Flow for detailed steps. ### Setup Access Control Configure access control to ensure only authorized subscribers can receive streamed data. Data Streams supports two access control types: User Roles (for Catalyst Authentication users with predefined roles) and Custom Logic (for custom authentication using Advanced I/O functions). Refer to Setup Access Control for detailed configuration. -------------------------------------------------------------------------------- title: "Dashboard" description: "Monitor Data Streams channel activity, live metrics, data transfer, triggers, and general configuration details from the Channel Dashboard." last_updated: "2026-10-08T06:47:52.526Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/dashboard/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Dashboard The Channel Dashboard provides a consolidated view of the activity, data flow, and configuration details of a Data Streams channel. It enables you to monitor live streaming activity, track subscriber engagement, and access channel configuration details such as Channel ID, access control type, and retention time. You can access the Channel Dashboard by selecting a channel from the Channels list page. ## Live Channel Activity This section displays real-time metrics that help you monitor the data streaming activity of a channel and its connected subscribers. * Messages Streamed - This metric displays the total number of messages streamed through the channel for the day. * Live Subscribers - This displays the number of subscribers currently connected to the channel and actively receiving streamed data. This value reflects the real-time count at the moment you view the dashboard. Note: You can aslo retrieve the live susbcriber count programatically using the getLiveCount() method in the SDK or through the Data Streams REST API. Refer to the Monitor Channel Activity guide for implementation details. ## Triggers The **Triggers** section displays the available methods for publishing data to the channel. These triggers enable you to stream data into the channel seamlessly. The following triggers are available: Signals: Use Catalyst Signals events to publish data to the channel and initiate channel actions in real-time responses. When events occur in connected services (such as Zoho CRM, Data Store, or custom publishers), they can be routed to the Data Streams channel through Signals rules and targets. Click Go to Signals to navigate to the Signals service and configure event-driven publishing for this channel. SDK Use the Catalyst SDK to publish data to the channel from your application code. This is ideal for scenarios where your backend service or function generates the data to be streamed. Click Learn more to view the publishing guide. Refer to the Key Concepts page to learn more about the different ways to publish data to a Data Streams channel. ## Data Transfer The _Data Transfer_ section presents the volume of data published through the channel over a selected time period in a graphical format. You can adjust the time frame using the time period selector in the top-right corner. You can choose from the default time ranges or specify a custom date range. You can select one of the following time periods to view channel data transfer: <table class="content-table"> <thead> <tr> <th class="w20p">Time Period</th> <th>Range</th> </tr> </thead> <tbody> <tr> <td>Today</td> <td>Displays the inbound data streamed through the channel from 12:00:00 AM of the current day until the present time. The graph shows the data volume received during each time interval within the day.</td> </tr> <tr> <td>Yesterday</td> <td>Displays the inbound data streamed through the channel during the entire previous day, from 12:00:00 AM to 11:59:59 PM.</td> </tr> <tr> <td>Last 7 days</td> <td>Displays the overall data transfer for each day of the last 7 days, including the current day until the present time. The previous 6 days are calculated starting from 12:00:00 AM of the first day.</td> </tr> <tr> <td>Last 30 days</td> <td>Displays the overall data transfer for each day of the last 30 days, including the current day until the present time. The previous 29 days are calculated starting from 12:00:00 AM of the first day.</td> </tr> <tr> <td>Custom Range</td> <td>Enables you to select a specific start and end date using the calendar picker, within a maximum interval of 2 months. The chart then displays the inbound data published through the channel within the selected date range.</td> </tr> </tbody> </table> The chart displays the inbound data size (in KB) received by the channel within the selected time range. Each data point on the graph corresponds to the volume of the data streamed into the channel during a specific time interval. Hovering over a data point displays the timestamp and the exact inbound data size recorded for that interval. Note: The Inbound Data Size represents the total amount of data received by the channel from publishers during each time interval. This value is displayed in kilobytes (KB) and reflects the volume of data entering the channel before it is distributed to subscribers. The graphical visualization helps you monitor data transmission trends and identify spikes in streaming activity over time. ## General Details The General Details section displays important configuration information about the channel. The following details are displayed in this section: * Channel ID - The unique identifier assigned to the channel while it is created. This ID is required when publishing data to the channel or when generating subscriber connection tokens using the SDK or API. * Created By - The user who created the channel. * Created On - The date the channel was created on. * Last Modified On - The timestamp of the most recent modification made to the channel configuration. * Control Type - The access control configured for the channel - either User Roles or Custom Logic. * Retention Time - The duration for which streamed data is retained in the channel after it is published. Note: Each Data Streams channel retains published data for 48 hours. Subscribers can reconnect within the retention period and receive events that were streamed during that time by using the appropriate subscribe type. You can edit the channel name or delete the channel from the channel page using the three-dot menu icon in the top-right corner. Refer to the Manage Channels guide for detailed instructions. ## Implementation -------------------------------------------------------------------------------- title: "Create a Data Streams Channel" description: "Step-by-step guide to creating a new Data Streams channel in the Catalyst Console with access control configuration." last_updated: "2026-10-08T06:47:52.528Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/create-channel/" service: "Cloud Scale" related: - Channels Overview (/en/cloud-scale/help/data-streams/channels-overview/) - Setup Access Control (/en/cloud-scale/help/data-streams/implementation/setup-access-control/) - Publish Data with SDK (/en/cloud-scale/help/data-streams/implementation/publish-data-sdk/) - Key Concepts (/en/cloud-scale/help/data-streams/key-concepts/) -------------------------------------------------------------------------------- # Create a Channel To create a new Data Streams channel: 1. Access **Data Streams** from the service menu under *Cloud Scale*. <br /> 2. Click the **Create Channel** button. <br /> 3. Enter a descriptive name for your channel (e.g., "user-notifications", "order-updates", "live-chat"). <br /> 4. Select an access control type to determine how subscribers will be authenticated when connecting to this channel: - **User Roles** — Restricts channel access to authenticated users with specific roles. Select **User Roles** from the dropdown and choose one or more roles from your Catalyst Authentication configuration. Use this when subscribers are authenticated users in your application with defined roles. - **Custom Logic** — Delegates authentication to an Advanced I/O function you define. Select **Custom Logic** from the dropdown and choose an existing function. Use this when you need custom authentication logic (SSO, API keys, anonymous users, device-based access). Note: For detailed access control configuration, refer to Setup Access Control. To create user roles, refer to the User Roles documentation. 5. Click **Create**. <br /> Your channel is ready to receive and distribute data. You will be redirected to the *Test Data Flow* section where you can verify that data flows correctly between publishers and subscribers. The **Channel ID** (required for all SDK and API interactions) is available in the *General Details* section of the *Dashboard* tab. <br /> Note: Always use the Channel ID in your code, not the Channel Name. The Channel ID never changes. -------------------------------------------------------------------------------- title: "Manage Data Streams Channels" description: "Edit channel names, update access control configuration, and delete Data Streams channels from the Catalyst Console." last_updated: "2026-10-08T06:47:52.528Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/manage-channels/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Setup Access Control (/en/cloud-scale/help/data-streams/implementation/setup-access-control/) - Channels Overview (/en/cloud-scale/help/data-streams/channels-overview/) -------------------------------------------------------------------------------- # Manage Channels Note: You must have a Data Streams channel already created before performing these operations. ### Edit Channel Name You can update the Channel Name at any time. The Channel ID remains unchanged. 1. Click the **three-dot menu** next to the channel. 2. Select **Edit**. <br /> 3. Update the **Channel Name**. 4. Click **Update** to save changes. <br /> 1. While viewing a channel, click the **three-dot menu** in the top-right corner. 2. Select **Edit**. <br /> 3. Update the **Channel Name**. 4. Click **Update** to save changes. <br /> Note: If your publishers or subscribers reference the channel by name in your code, you must update those references. If you use the Channel ID (recommended), no code changes are needed. ### Edit Access Control To update subscriber authentication rules: 1. Go to the **Access Control** tab. <br /> 2. Click **Edit** in the **Subscriber Access** section. <br /> 3. Modify the access control configuration: - **User Roles** — Add or remove roles - **Custom Logic** — Select a different Advanced I/O function 4. Click **Update** to save changes. Note: When revoking access, subscribers lose access immediately and active connections are terminated. When granting access, new users can subscribe and already-connected users will continue receiving data. Refer to Setup Access Control for detailed configuration guidance. ### Delete a Channel Note: This action cannot be undone. All active connections will be terminated immediately. Publishers will no longer be able to send data, and subscribers will no longer receive events. 1. Click the **three-dot menu** next to the channel. 2. Select **Delete**. <br /> 3. Type the **Channel Name** in the confirmation dialog. 4. Click **Delete** to confirm. 1. While viewing a channel, click the **three-dot menu** in the top-right corner. 2. Select **Delete**. <br /> 3. Type the **Channel Name** in the confirmation dialog. <br /> 4. Click **Delete** to confirm. -------------------------------------------------------------------------------- title: "Publish Data to Channel Using SDK" description: "Publish data to Data Streams channels from server-side Catalyst functions using Java, JavaScript, or Python SDK." last_updated: "2026-10-08T06:47:52.529Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/publish-data-sdk/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Key Concepts - Publishing Methods (/en/cloud-scale/help/data-streams/key-concepts/#publishing-methods) - Advanced I/O Functions (/en/serverless/help/functions/advanced-io/) - Java SDK (/en/sdk/java/v1/cloud-scale/data-streams/) - JavaScript SDK (/en/sdk/javascript/v1/cloudscale/data-streams/) - Python SDK (/en/sdk/python/v1/cloud-scale/data-streams/) -------------------------------------------------------------------------------- # Publish Data with SDK To publish data to a Data Streams channel using the Catalyst SDK: Note: You must have a Data Streams channel created (you'll need the Channel ID) and an Advanced I/O function for publishing. Publishing requires admin-level authentication. The publishData() method can only be called from a server-side Catalyst function, not from client/browser applications. 1. Navigate to your Advanced I/O function directory and install the SDK for your runtime. npm install @zcatalyst/datastreams Add the following dependency to your pom.xml: <!-- Refer to SDK documentation for the latest version --> <dependency> <groupId>com.zoho.catalyst</groupId> <artifactId>datastreams</artifactId> <version>LATEST</version> </dependency> pip install zcatalyst-sdk 2. Initialize the SDK in your function code. The SDK automatically resolves project credentials from the execution environment. const { DataStreams } = require('@zcatalyst/datastreams'); module.exports = async (req, res) => { const datastreams = new DataStreams(); // ... use datastreams methods }; import com.zc.component.datastream.ZCDatastream; ZCDatastream datastream = ZCDatastream.getInstance(); import zcatalyst_sdk app = zcatalyst_sdk.initialize_app() data_streams = app.datastreams() Note: Do not use DataStreamsWebSocket for publishing. That class is for subscribers only. 3. Use the publishData() method to send data to your channel. **Method Parameters:** <table class="content-table"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>string</td> <td>The unique Channel ID from the console</td> </tr> <tr> <td>data</td> <td>string (JavaScript/Java)<br>string or dict (Python)</td> <td>The data to publish</td> </tr> </tbody> </table> **Publish text data:** const result = await datastreams.publishData('YOUR_CHANNEL_ID', 'Hello, subscribers!'); console.log('Published successfully:', result); Boolean result = datastream.publishData("YOUR_CHANNEL_ID", "Hello, subscribers!"); System.out.println("Published successfully: " + result); result = data_streams.publish_data("YOUR_CHANNEL_ID", "Hello, subscribers!") print("Published successfully:", result) 4. For structured data, stringify your JSON before publishing (JavaScript/Java) or pass a dictionary (Python). const payload = JSON.stringify({ event: 'temperature_update', value: 23.5, unit: 'celsius', timestamp: Date.now() }); const result = await datastreams.publishData('YOUR_CHANNEL_ID', payload); console.log('Published successfully:', result); Note: Always use JSON.stringify(). Passing an object directly will throw a validation error. String payload = new Gson().toJson(Map.of( "event", "temperature_update", "value", 23.5, "unit", "celsius", "timestamp", System.currentTimeMillis() )); Boolean result = datastream.publishData("YOUR_CHANNEL_ID", payload); System.out.println("Published successfully: " + result); Note: Use Gson or another JSON library to convert objects to strings. # Python SDK accepts dictionaries directly result = data_streams.publish_data("YOUR_CHANNEL_ID", { "event": "temperature_update", "value": 23.5, "unit": "celsius", "timestamp": time.time() }) print("Published successfully:", result) # Or pass a JSON string import json payload = json.dumps({"event": "order_placed", "order_id": 12345}) result = data_streams.publish_data("YOUR_CHANNEL_ID", payload) Note: Python SDK handles both dictionaries and JSON strings. After publishing, data is sent to the Data Streams channel where it is distributed to all active subscribers in real-time. Publishing succeeds even if no subscribers are connected; data is retained for 48 hours. ### Common Errors <table class="content-table"> <thead> <tr> <th>Error</th> <th>Cause</th> <th>Solution</th> </tr> </thead> <tbody> <tr> <td>Invalid Channel ID</td> <td>Wrong or non-existent channel</td> <td>Verify Channel ID in console</td> </tr> <tr> <td>Data must be a string</td> <td>Passed object instead of string</td> <td>Use JSON.stringify() (JavaScript/Java)</td> </tr> <tr> <td>Unauthorized</td> <td>Called from client-side</td> <td>Move to server-side function</td> </tr> <tr> <td>Channel not found</td> <td>Channel deleted</td> <td>Recreate channel or update Channel ID</td> </tr> </tbody> </table> -------------------------------------------------------------------------------- title: "Publish Data Using Signals Integration" description: "Automatically publish data to Data Streams channels when events occur in connected services using Catalyst Signals event bus." last_updated: "2026-10-08T06:47:52.529Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/publish-data-signals/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Publish Data with SDK (/en/cloud-scale/help/data-streams/implementation/publish-data-sdk/) - Catalyst Signals (/en/signals/getting-started/introduction/) - Key Concepts - Publishing Methods (/en/cloud-scale/help/data-streams/key-concepts/#publishing-methods) -------------------------------------------------------------------------------- # Publish Data with Signals To automatically publish data to a Data Streams channel when events occur in connected services: Note: You must have created a Data Streams channel (you'll need the Channel ID), Catalyst Signals enabled in your project, and an event source configured (e.g., Catalyst Authentication, Data Store, Zoho CRM, or custom webhooks). Signals is an event bus service that routes events from publishers to targets without requiring custom code. 1. Configure a Signals Publisher (the event source that emits events). 1. Navigate to your Data Streams channel. 2. Go to the **Dashboard** tab. 3. Find the *Triggers* section. 4. Click **Go to Signals** next to "Signals". <br /> This redirects you to Catalyst Signals with the channel context pre-loaded. 1. Navigate to **Catalyst Signals** in the console. 2. Go to the *Publishers* section. 3. Click **Create Publisher**. 4. Select your event source: - **Catalyst Services** — Authentication, Data Store, Cache, Stratus - **Zoho Services** — CRM, Desk, Projects - **Custom Webhooks** — External services 5. Configure the publisher settings. 6. Click **Create**. Note: For detailed publisher configuration, refer to Catalyst Signals Publishers documentation. 2. Create a Signals Rule (defines when and how events should be routed). - In Catalyst Signals, navigate to *Rules*. - Click **Create Rule**. - Configure the rule: - **Name** — Descriptive name (e.g., "Route user signups to notifications channel") - **Publisher** — Select the publisher you configured - **Event Filter** — (Optional) Filter specific events - **Condition** — (Optional) Add conditions to route only certain events - Click **Create**. Note: For detailed rule configuration, refer to Signals Rules documentation. 3. Add a Data Streams Target (specifies where the event should be sent). - While creating or editing a rule, scroll to the *Targets* section. - Click **Add Target**. - Select **Data Streams** from the target type dropdown. - Enter your **Channel ID** (from the Data Streams console). - Click **Add**. - Save the rule. Note: For detailed target configuration, refer to Signals Targets documentation. 4. Test the configuration by triggering an event in your source service: - **Catalyst Authentication** — Create a test user signup - **Data Store** — Insert a row in the configured table - **Zoho CRM** — Create or update a record - **Custom Webhook** — Send a test POST request 5. Verify in Data Streams: - Navigate to your Data Streams channel. - Go to the *Test Data Flow* tab. - Click the **Receive** tab. - Click **Activate Stream**. - Watch the event appear in real-time. <br /> When events occur in connected services, Signals automatically publishes them to your Data Streams channel where all connected subscribers receive the data in real-time. -------------------------------------------------------------------------------- title: "Setup Access Control for Data Streams" description: "Configure User Roles or Custom Logic authentication to control subscriber access to Data Streams channels." last_updated: "2026-10-08T06:47:52.532Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/setup-access-control/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Manage Channels (/en/cloud-scale/help/data-streams/implementation/manage-channels/) - User Roles - Catalyst Authentication (/en/cloud-scale/help/authentication/user-management/roles/introduction/) - Advanced I/O Functions (/en/serverless/help/functions/advanced-io/) -------------------------------------------------------------------------------- # Setup Access Control To configure access control for your channel: Note: You should have a channel created before configuring access control. Access control applies only to subscribers. Publishers are authenticated through the Catalyst SDK or the REST API and do not require access control configuration. 1. Select an access control type during channel creation or from the *Access Control* section. Use this when subscribers are authenticated users in Catalyst Authentication with predefined roles. 2. Select **User Roles**. 3. Select one or more roles from the dropdown menu. <br /> 4. Click **Create** or **Update**. Only users belonging to the selected roles can subscribe to the channel. When a role is removed, subscribers with that role lose access immediately. When a role is granted, users with that role can subscribe immediately. Note: To create new roles, refer to the Catalyst Authentication User Roles documentation. Use this when you need custom authentication logic beyond role-based access (SSO, session-based connections, anonymous users, or custom criteria). 2. Create an Advanced I/O function that handles subscriber authentication: module.exports = async (req, res) => { const { userId, connectionName } = req.body; // Your custom validation logic const isAuthorized = await yourCustomValidationLogic(userId); if (isAuthorized) { res.status(200).json({ approved: true }); } else { res.status(403).json({ approved: false, reason: "Unauthorized" }); } }; The function must accept connection requests, perform validation logic, and return approval or rejection. 3. Select **Custom Logic**. 4. Select your Advanced I/O function from the dropdown. If the function doesn't exist, click **Create new Advanced I/O function** to create one first. <br /> 5. Click **Create** or **Update**. Note: Only Advanced I/O functions are supported. Ensure the function is deployed and available in your project before configuring it. ### Manage Subscriber Connections After access control is configured, navigate to the *Manage Connections* section in the *Access Control* tab to view all subscribers. <br /> Each connection displays: <table class="content-table"> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Connection Name</td> <td>Unique identifier for the subscriber connection (generated during token pair creation)</td> </tr> <tr> <td>User Type</td> <td>Type of user (App User or Custom User) based on access control configuration</td> </tr> <tr> <td>Status</td> <td>Current connection state: Active, Inactive, or Blocked</td> </tr> </tbody> </table> **To block a subscriber:** 1. Locate the subscriber connection. 2. Click the **three-dot menu** icon. 3. Select **Block**. <br /> Blocking terminates the active connection immediately. **To delete a subscriber connection:** 1. Locate the subscriber connection. 2. Click the **three-dot menu** icon. 3. Select **Delete**. 4. Confirm deletion in the dialog. -------------------------------------------------------------------------------- title: "Generate Token Pair for Subscribers" description: "Create authentication credentials for subscribers to establish WebSocket connections to Data Streams channels." last_updated: "2026-10-08T06:47:52.532Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/generate-token-pair/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Setup Access Control (/en/cloud-scale/help/data-streams/implementation/setup-access-control/) - Subscribe with WebSocket (/en/cloud-scale/help/data-streams/implementation/subscribe-websocket/) - Key Concepts - Tokens (/en/cloud-scale/help/data-streams/key-concepts/#token-pair) -------------------------------------------------------------------------------- # Generate Token Pair A token pair provides the authentication credentials required for subscribers to establish WebSocket connections to a Data Streams channel. Before you begin, ensure you have created a channel, configured access control, and an Advanced I/O function to host the token generation endpoint. Note: Token pair generation is a server-side operation that requires admin-level authentication. You must call getTokenPair() from a Catalyst Advanced I/O function and return the token pair to the client for WebSocket connection. Never expose token generation logic in client-side code. A token pair contains the WebSocket server URL (url), session identifier (wss_id or zuid), authentication key (key), and channel ID (channel_id). ### Create Token Generation Endpoint Create an Advanced I/O function that generates and returns token pairs to clients. You can generate a token pair using either User ID (for authenticated users with Catalyst Authentication) or Connection Name (for anonymous or device-based connections). You must provide at least one. <table class="content-table"> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>string</td> <td>The unique identifier of the channel to subscribe to</td> </tr> <tr> <td>userId</td> <td>string / Long (Java)</td> <td>The Catalyst project user ID (for authenticated users)</td> </tr> <tr> <td>connectionName</td> <td>string</td> <td>Custom connection identifier (for anonymous/device connections)</td> </tr> </tbody> </table> const { DataStreams } = require('@zcatalyst/datastreams'); module.exports = async (req, res) => { const datastreams = new DataStreams(); // Option 1: Using a user ID (for authenticated users) const tokenByUser = await datastreams.getTokenPair('YOUR_CHANNEL_ID', { userId: 'YOUR_USER_ID' }); // Option 2: Using a connection name (for anonymous users) const tokenByName = await datastreams.getTokenPair('YOUR_CHANNEL_ID', { connectionName: 'YOUR_CONNECTION_NAME' }); // Return token pair to client res.setHeader('Content-Type', 'application/json'); res.writeHead(200); res.end(JSON.stringify({ status: 'success', data: tokenByUser })); }; import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCTokenResponse; ZCDatastream datastream = ZCDatastream.getInstance(); // Option 1: Using a user ID (Long type for authenticated users) Long userId = 30772000000631094L; ZCTokenResponse tokenByUser = datastream.getTokenPair("YOUR_CHANNEL_ID", userId); // Option 2: Using a connection name (String type for anonymous users) ZCTokenResponse tokenByName = datastream.getTokenPair("YOUR_CHANNEL_ID", "YOUR_CONNECTION_NAME"); // Return tokenByUser or tokenByName to client import zcatalyst_sdk app = zcatalyst_sdk.initialize_app() data_streams = app.datastreams() # Option 1: Using a user ID (for authenticated users) token_by_user = data_streams.get_token_pair("YOUR_CHANNEL_ID", user_id="YOUR_USER_ID") # Option 2: Using a connection name (for anonymous users) token_by_name = data_streams.get_token_pair("YOUR_CHANNEL_ID", connection_name="YOUR_CONNECTION_NAME") # Return token to client ### Deploy and Test To deploy and test your token generation endpoint: 1. Deploy your Advanced I/O function 2. Call the function endpoint from your client application 3. The client receives the token pair response: { "url": "wss://datastreams.zoho.com", "wss_id": "abc123sessionid", "key": "authentication_key_here", "channel_id": "1234567890" } ### Example Implementation Server (Advanced I/O Function): const { DataStreams } = require('@zcatalyst/datastreams'); module.exports = async (req, res) => { try { const datastreams = new DataStreams(); const { channelId, userId, connectionName } = req.body; // Generate token pair const tokenPair = await datastreams.getTokenPair(channelId, { userId: userId || undefined, connectionName: connectionName || undefined }); res.status(200).json({ success: true, token: tokenPair }); } catch (error) { res.status(500).json({ success: false, error: error.message }); } }; Client (Request token from server): // Client-side: Fetch token pair from your server const response = await fetch('https://your-function-url.com/get-token', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ channelId: 'YOUR_CHANNEL_ID', userId: 'current_user_id' // or connectionName: 'device_123' }) }); const { token } = await response.json(); // Now use token to create WebSocket connection Always validate subscriber identity before generating tokens, use User ID for authenticated users, and use Connection Name for anonymous connections. Tokens are scoped to specific channels. You can find further steps on subscribing with WebSocket to create connections using the token pair, testing data flow to verify token generation, Token Pairs in Key Concepts, and WebSocket Connections. -------------------------------------------------------------------------------- title: "Subscribe to Data Streams via WebSocket" description: "Connect to Data Streams channels and receive real-time data using WebSocket connections with Java, JavaScript, or Python SDK." last_updated: "2026-10-08T06:47:52.532Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/subscribe-websocket/" service: "Cloud Scale" related: - Generate Token Pair (/en/cloud-scale/help/data-streams/implementation/generate-token-pair/) - Key Concepts - Subscriber Types (/en/cloud-scale/help/data-streams/key-concepts/#subscriber-types) - Key Concepts - Acknowledgement (/en/cloud-scale/help/data-streams/key-concepts/#acknowledgement) - Setup Access Control (/en/cloud-scale/help/data-streams/implementation/setup-access-control/) -------------------------------------------------------------------------------- # Subscribe to Channel via WebSocket Subscribe to a Data Streams channel to receive data from publishers in real time over a WebSocket connection. Before you begin, ensure you have a channel created, access control configured, and a token pair available. Subscriptions are typically established from client-side applications (web or mobile) because WebSocket connections are long-lived and must remain open to receive data continuously. Note: The JavaScript SDK supports browser environments for subscriber operations. ### Install the Data Streams SDK npm install @zcatalyst/datastreams Add to pom.xml: <!-- Refer to SDK documentation for latest version --> <dependency> <groupId>com.zoho.catalyst</groupId> <artifactId>datastreams</artifactId> <version>LATEST</version> </dependency> pip install zcatalyst-sdk ### Get Token Pair from Server First, request a token pair from your server endpoint (created in generate-token-pair): // Client-side example const response = await fetch('https://your-server.com/get-token', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ channelId: 'YOUR_CHANNEL_ID', userId: 'current_user_id' }) }); const { token } = await response.json(); // token contains: { url, wss_id, key, channel_id } ### Create WebSocket Connection Use the token pair to create a WebSocket client instance. The SDK handles authentication automatically. const { DataStreamsWebSocket } = require('@zcatalyst/datastreams'); const socket = new DataStreamsWebSocket({ url: token.url, zuid: token.wss_id, key: token.key, enableLogging: true // Optional: enable debug logging }); import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCDataStreamsConfig; import com.zc.component.datastream.websocket.ZCDataStreamsWebSocket; ZCDatastream datastream = ZCDatastream.getInstance(); ZCDataStreamsConfig config = new ZCDataStreamsConfig( tokenResponse.getUrl(), tokenResponse.getWssId(), tokenResponse.getKey(), false // enableLogging ); ZCDataStreamsWebSocket socket = datastream.createWebSocketClient(config); from zcatalyst_sdk.datastreams.websocket_client import DataStreamsWebSocket from zcatalyst_sdk.types.datastreams import DataStreamsConfig config = DataStreamsConfig( url=token["url"], zuid=token["wss-id"], key=token["key"], enable_logging=True ) socket = DataStreamsWebSocket(config=config) Note: In Python, the WebSocket connection is not opened until you call socket.connect() after registering your event listeners. ### Choose Your Subscriber Type Before subscribing, decide which subscriber type fits your use case: <table class="content-table"> <thead> <tr> <th>Type</th> <th>Value</th> <th>When to Use</th> </tr> </thead> <tbody> <tr> <td>Live events only</td> <td>'0'</td> <td>Start receiving only NEW messages published after subscribing</td> </tr> <tr> <td>Earliest available</td> <td>'-1'</td> <td>Receive ALL available messages from the earliest stored event (within 48-hour retention)</td> </tr> <tr> <td>Resume</td> <td>'-2'</td> <td>Resume from where you last left off (or live events for new subscribers)</td> </tr> <tr> <td>Specific Streaming ID</td> <td>'<streaming-id>'</td> <td>Resume from a specific message (use the streamingId from a previous message)</td> </tr> </tbody> </table> Note: Data retention is 48 hours. Events older than 48 hours are not available. ### Register Event Listeners and Subscribe // Listen for connection opened socket.on('open', () => { console.log('Connected! Subscribing to channel...'); // Subscribe with your chosen subscriber type socket.subscribe('0'); // Live events only // socket.subscribe('-1'); // Earliest available // socket.subscribe('-2'); // Resume // socket.subscribe('16965000000027481'); // From specific streaming ID }); // Listen for incoming messages socket.on('message', (event) => { console.log('Received:', event.data); console.log('Streaming ID:', event.streamingId); // Process your message here // ... // CRITICAL: Always send acknowledgement to receive next message socket.sendAck(); }); // Listen for errors socket.on('error', (err) => { console.error('Error:', err.code, err.message); }); // Listen for connection closed socket.on('close', () => { console.log('Connection closed'); }); import com.zc.component.datastream.websocket.ZCDataStreamsEventListener; import com.zc.component.datastream.beans.ZCCustomEvent; import com.zc.component.datastream.beans.ZCDataStreamMessageEvent; socket.addEventListener(new ZCDataStreamsEventListener() { @Override public void onOpen(ZCCustomEvent event) { System.out.println("Connected! Subscribing to channel..."); // Subscribe with your chosen subscriber type socket.subscribe("0"); // Live events only // socket.subscribe("-1"); // Earliest available // socket.subscribe("-2"); // Resume } @Override public void onMessage(ZCDataStreamMessageEvent event) { System.out.println("Received: " + event.getData()); System.out.println("Streaming ID: " + event.getStreamingId()); // Process your message here // ... // CRITICAL: Always send acknowledgement to receive next message socket.sendAck(); } @Override public void onError(ZCCustomEvent event) { System.err.println("Error: " + event.getMessage()); } @Override public void onClose(ZCCustomEvent event) { System.out.println("Connection closed"); } @Override public void onPong(ZCCustomEvent event) { // Keep-alive pong received } }); def on_open(event): print("Connected! Subscribing to channel...") # Subscribe with your chosen subscriber type socket.subscribe("0") # Live events only # socket.subscribe("-1") # Earliest available # socket.subscribe("-2") # Resume def on_message(event): print("Received:", event.data) print("Streaming ID:", event.streaming_id) # Process your message here # ... # CRITICAL: Always send acknowledgement to receive next message socket.send_ack() def on_error(event): print("Error:", event.code, event.message) def on_close(event): print("Connection closed") # Register event listeners socket.set_on_open(on_open) socket.set_on_message(on_message) socket.set_on_error(on_error) socket.set_on_close(on_close) # Connect (Python requires explicit connect call) socket.connect() ### Handle Message Events Each message event received contains: <table class="content-table"> <thead> <tr> <th>Field</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>operation</td> <td>string</td> <td>Event type: 'event' for inline data or 'api' for bulk data</td> </tr> <tr> <td>streamingId</td> <td>string</td> <td>Unique identifier for this message in the stream</td> </tr> <tr> <td>data</td> <td>string</td> <td>The published data (for inline events)</td> </tr> <tr> <td>url</td> <td>string</td> <td>URL to fetch bulk data (for bulk/api events)</td> </tr> <tr> <td>method</td> <td>string</td> <td>HTTP method for fetching bulk data (for bulk/api events)</td> </tr> </tbody> </table> ### Example: Processing Different Event Types socket.on('message', (event) => { if (event.operation === 'event') { // Inline data console.log('Data:', event.data); const parsedData = JSON.parse(event.data); // Process parsedData... } else if (event.operation === 'api') { // Bulk data - fetch from URL console.log('Bulk data available at:', event.url); // Fetch and process bulk data... } // Always acknowledge socket.sendAck(); }); ### Send Acknowledgement You must call sendAck() after processing each message. - Until acknowledgement is sent, the next message will NOT be delivered - This ensures ordered, reliable message delivery - If you disconnect before acknowledging, you can reconnect using subscriber type '-2' to resume // JavaScript socket.sendAck(); // Java socket.sendAck(); // Python socket.send_ack() ### Unsubscribe and Disconnect When you're done receiving data: // Unsubscribe: ends the session. Generate a new token pair to subscribe again. socket.unsubscribe(); // Or disconnect only: reconnect later and resume with subscribe type "-2". socket.close(); // Unsubscribe: ends the session. Generate a new token pair to subscribe again. socket.unsubscribe(); // Or disconnect only: reconnect later and resume with subscribe type "-2". socket.close(); # Unsubscribe: ends the session. Generate a new token pair to subscribe again. socket.unsubscribe() # Or disconnect only: reconnect later and resume with subscribe type "-2". socket.close() ### Example Implementation const { DataStreamsWebSocket } = require('@zcatalyst/datastreams'); async function subscribeToChannel() { // 1. Get token from server const response = await fetch('https://your-server.com/get-token', { method: 'POST', body: JSON.stringify({ channelId: 'YOUR_CHANNEL_ID', userId: 'user123' }) }); const { token } = await response.json(); // 2. Create WebSocket connection const socket = new DataStreamsWebSocket({ url: token.url, zuid: token.wss_id, key: token.key, enableLogging: true }); // 3. Register event listeners socket.on('open', () => { console.log('Connected!'); socket.subscribe('0'); // Live events }); socket.on('message', (event) => { console.log('Received:', event.data); // Process message const data = JSON.parse(event.data); updateUI(data); // Acknowledge socket.sendAck(); }); socket.on('error', (err) => { console.error('Error:', err); }); socket.on('close', () => { console.log('Disconnected'); }); } subscribeToChannel(); The SDK manages the connection lifecycle automatically: opens the WebSocket connection, validates the token pair, subscribes when you call subscribe(), and pushes messages with the acknowledgement flow. You can find further details on Subscriber Types, Message Event Structure, Acknowledgement, Connection Lifecycle, and Data Retention. -------------------------------------------------------------------------------- title: "Test Data Flow from Console" description: "Verify Data Streams channel setup by testing publishing and subscribing directly from the Catalyst Console without code." last_updated: "2026-10-08T06:47:52.533Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/test-data-flow-console/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Publish Data with SDK (/en/cloud-scale/help/data-streams/implementation/publish-data-sdk/) - Subscribe with WebSocket (/en/cloud-scale/help/data-streams/implementation/subscribe-websocket/) - Key Concepts - Message Event Structure (/en/cloud-scale/help/data-streams/key-concepts/#message-event-structure) -------------------------------------------------------------------------------- # Test Data Flow After creating a channel or any time you open an existing channel from the Channels list page, you will be directed to the Test Data Flow section. This section enables you to verify how data is published and received through the channel before implementing it in your application. Using this interface, you can simulate both a publisher and a subscriber directly from the Catalyst Console, without writing any code or deploying a function. Note: Data sent through the Test Data Flow section is treated as a real streaming event. It will be delivered to all active subscribers connected to the channel, including any subscriber connections established through the SDK or API. The Test Data Flow section contains two primary actions: Send and Receive. ### Send Test Data The Send tab allows you to simulate a publisher and send sample data to the channel. The data you send will be treated as a real streaming event and will be delivered to any active subscribers connected to the channel, including the test receiver in the console. To test publishing: 1. Navigate to the Send tab in the Test Data Flow section of your channel. 2. Enter the sample payload in the Enter Data Payload field. 3. Click Send to publish the data to the channel. This allows you to verify how event data will be published by your application services. You can use this to confirm that the channel is correctly configured before integrating the publishing logic in your application. ### Receive Channel Data The Receive tab allows you to simulate a subscriber and listen for incoming events from the channel. To start receiving events: 1. Navigate to the Receive tab in the Test Data Flow section of your channel. 2. Click Activate Stream to establish a test subscription. 3. The console will begin listening for events published to the channel. 4. Any incoming data will appear in the Receive channel data panel in real time. Each event displayed will include the following fields: * data – the payload that was published to the channel. * streamingId – the unique identifier assigned to that event in the stream. These fields correspond to the message event structure that your application will receive when subscribing through the SDK. ### Event Acknowledgement After receiving an event, you must click Send Acknowledgement to confirm that the message has been processed. Data Streams delivers events in sequence, and the acknowledgement ensures that the next event in the stream can be delivered. Until the acknowledgement is sent, subsequent events will not be displayed in the receiver. This behavior mirrors the sendAck() method used in the SDK. In your application code, you must call sendAck() after processing each message to receive the next one. Refer to the Subscribe with WebSocket guide for implementation details. ### Closing the Test Stream You can stop the test receiver at any time by clicking Disconnect. Once disconnected, the test subscriber will no longer receive events from the channel. If you do not manually disconnect, the test connection will be closed automatically after two minutes. Note: Clicking Disconnect only stops the test connection created in the console. It does not affect any subscriber connections established through the SDK or API. The test connection will also be closed automatically after two minutes if not manually disconnected. ### Set Up Data Streams The right side of the Test Data Flow section provides example code snippets for sending or receiving events using the Catalyst SDK. Snippets are available in supported languages including Java, JavaScript, and Python. These examples help you implement the same publishing and subscribing behavior in your application. For complete implementation details, refer to the SDK and API documentation. -------------------------------------------------------------------------------- title: "Monitor Data Streams Channel Activity" description: "Track live channel metrics, data transfer, triggers, and performance insights from the Data Streams Dashboard." last_updated: "2026-10-08T06:47:52.536Z" source: "https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/implementation/monitor-channel-activity/" service: "Cloud Scale" related: - Create a Channel (/en/cloud-scale/help/data-streams/implementation/create-channel/) - Test Data Flow (/en/cloud-scale/help/data-streams/implementation/test-data-flow-console/) - Dashboard Overview (/en/cloud-scale/help/data-streams/dashboard/) -------------------------------------------------------------------------------- # Monitor Channel Activity The Channel Dashboard provides real-time insights into your Data Streams channel's activity, data flow, and performance metrics. Before you begin, ensure you have a channel created with data flowing through it (publishers and/or subscribers active). ## Access the Dashboard Navigate to your channel from the Channels list page. The dashboard is displayed by default when you open a channel. ## Live Channel Activity Monitor real-time metrics to understand current channel performance. ### Metrics Available <table class="content-table"> <thead> <tr> <th>Metric</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Messages Streamed</td> <td>Total number of messages streamed through the channel for the day</td> </tr> <tr> <td>Live Subscribers</td> <td>Number of subscribers currently connected and actively receiving data (real-time count)</td> </tr> </tbody> </table> ### Programmatic Access You can retrieve the live subscriber count programmatically: // JavaScript const liveCount = await datastreams.getLiveCount('YOUR_CHANNEL_ID'); console.log('Live subscribers:', liveCount); Note: Refer to SDK documentation or REST API for implementation details. ## Configure Triggers The **Triggers** section displays available methods for publishing data to your channel. ### Available Triggers #### Catalyst Signals (Event-Driven) Use Catalyst Signals to automatically publish data when events occur in connected services: - Zoho CRM record updates - Data Store row insertions - Authentication user signups - Custom service events To configure: 1. Click **Go to Signals** 2. Configure Signals Publishers, Rules, and Targets 3. Route events to your Data Streams channel Refer to the Publish Data with Signals guide for complete integration details. #### Catalyst SDK (Manual Publishing) Use the SDK to publish data from your application code: - Backend services and functions - Custom business logic - Data processing workflows To configure: 1. Click **Learn more** to view publishing guide 2. Implement publishing in your Advanced I/O function Refer to the Publish Data with SDK guide for complete implementation details. Note: Refer to Publishing Methods in Key Concepts to learn about all available publishing options. ## Analyze Data Transfer The **Data Transfer** section visualizes data volume over time, helping you identify usage patterns and activity spikes. ### Select Time Period Choose from preset ranges or define a custom period: <table class="content-table"> <thead> <tr> <th>Time Period</th> <th>Range</th> <th>Use Case</th> </tr> </thead> <tbody> <tr> <td>Today</td> <td>12:00:00 AM → Current time</td> <td>Monitor today's activity</td> </tr> <tr> <td>Yesterday</td> <td>Previous day (12:00:00 AM → 11:59:59 PM)</td> <td>Compare with today</td> </tr> <tr> <td>Last 7 days</td> <td>Rolling 7-day window</td> <td>Identify weekly trends</td> </tr> <tr> <td>Last 30 days</td> <td>Rolling 30-day window</td> <td>Monitor monthly patterns</td> </tr> <tr> <td>Custom Range</td> <td>Up to 2 months</td> <td>Specific date analysis</td> </tr> </tbody> </table> The chart displays **Inbound Data Size (KB)** over your selected time period. The X-axis shows time intervals, the Y-axis shows data volume in kilobytes, and you can hover over data points to view exact timestamps and data sizes. Note: Inbound Data Size represents the total data received by the channel from publishers before distribution to subscribers. ## View General Details The **General Details** section displays channel configuration and metadata. ### Available Information <table class="content-table"> <thead> <tr> <th>Field</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>Channel ID</td> <td>Unique identifier (required for SDK/API operations)</td> </tr> <tr> <td>Created By</td> <td>User who created the channel</td> </tr> <tr> <td>Created On</td> <td>Timestamp when the channel was created</td> </tr> <tr> <td>Last Modified On</td> <td>Timestamp of most recent configuration change</td> </tr> <tr> <td>Control Type</td> <td>Access control method (User Roles or Custom Logic)</td> </tr> <tr> <td>Retention Time</td> <td>Data retention period (48 hours)</td> </tr> </tbody> </table> ### Data Retention Details - **Retention Period**: 48 hours from publication - **Subscriber Access**: Can receive events within retention period using subscriber types: - `'-1'` (earliest available) - `'-2'` (resume) - `'<streaming-id>'` (from specific point) - **After 48 Hours**: Events are no longer available Note: Learn more about Subscriber Types and Data Retention. ## Dashboard Actions From the three-dot menu in the top-right corner: - **Edit Channel** → Change channel name - **Delete Channel** → Permanently remove channel Note: For details on editing or deleting channels, refer to Manage Channels. --- ## API Reference — Data Streams -------------------------------------------------------------------------------- title: "Get All Channels" description: "This API retrieves the list of all Datastream channels created in the specified Catalyst project." last_updated: "2026-10-08T06:47:52.544Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/get-all-channels/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Get All Channels ### Description This API retrieves the list of all Datastream channels created in the specified Catalyst project. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/datastreams/channel</p> The DC-specific domain used to access Catalyst APIs The unique ID of the Catalyst project <br> #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.datastreams.channel.READ ### Response Details On successful execution, the response contains a list of all Datastream channels available in the specified project along with their corresponding metadata. curl -X GET \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel \ -H "Authorization: Zoho-oauthtoken 1000.f53426c0cee59aaa57f1f158f5f271ca.ba782e5510151a126a08232e7958b24d" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" Get Channels- Java SDK<br/><br/> Get Channels- Node.js SDK<br/><br/> Get Channels- Python SDK -------------------------------------------------------------------------------- title: "Publish Data" description: "This API allows an authorized admin to publish streaming data to a Datastream channel. Any active subscribers connected to the channel receive the published data in real time through the WebSocket connection." last_updated: "2026-10-08T06:47:52.545Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/publish-data/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Publish Data - Admin ### Description This API allows an authorized admin to publish streaming data to a Datastream channel. Any active subscribers connected to the channel receive the published data in real time through the WebSocket connection. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_id}/stream</p> The DC-specific domain used to access Catalyst APIs The unique ID of the Catalyst project The unique ID of the Datastream channel <br> #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token}<br> **Content-Type:** application/json **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Request Body The payload that is published to the Datastream channel #### Scope ZohoCatalyst.datastreams.channel.stream.CREATE ### Response Details On successful execution, the data payload is published to the specified Datastream channel and delivered in real time to all connected subscribers if there are any. curl -X POST \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/20084000000662015/stream \ -H "Authorization: Zoho-oauthtoken 1000.f53426c0cee59aaa57f1f158f5f271ca.ba782e5510151a126a08232e7958b24d" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" \ -H "Content-Type: application/json" \ -d '{ "data": { "name": "data streams" } }' Publish Data- Java SDK<br/><br/> Publish Data- Node.js SDK<br/><br/> Publish Data- Python SDK -------------------------------------------------------------------------------- title: "Get Channel Details" description: "This API lets you retrieve the details of a specific Datastream channel that was created from the Catalyst console." last_updated: "2026-10-08T06:47:52.545Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/get-channel-details/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Get Channel Details ### Description This API lets you retrieve the details of a specific Datastream channel that was created from the Catalyst console. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_id}</p> The DC-specific domain used to access Catalyst APIs The unique ID of the Catalyst project The unique ID of the Datastream channel <br> #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.datastreams.channel.READ ### Response Details On successful execution, this API returns the configuration and metadata associated with the specified Datastream channel. curl -X GET \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/20084000000589013 \ -H "Authorization: Zoho-oauthtoken 1000.f53426c0cee59aaa57f1f158f5f271ca.ba782e5510151a126a08232e7958b24d" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" Get Channels- Java SDK<br/><br/> Get Channels- Node.js SDK<br/><br/> Get Channels- Python SDK -------------------------------------------------------------------------------- title: "Get Live Count" description: "This API retrieves the number of active live clients currently connected to a specific Datastream channel." last_updated: "2026-10-08T06:47:52.545Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/get-live-count/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Get Live Count ### Description This API retrieves the number of active live clients currently connected to a specific Datastream channel. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_name}/liveclient</p> The DC-specific domain used to access Catalyst APIs The unique ID of the Catalyst project The name of the Datastream channel <br> #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token} **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Scope ZohoCatalyst.datastreams.connections.READ ### Response Details On successful execution, the response contains the count of live clients or list of subscribers currently connected to the specified Datastream channel. curl -X GET \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/testing/liveclient \ -H "Authorization: Zoho-oauthtoken 1000.f53426c0cee59aaa57f1f158f5f271ca.ba782e5510151a126a08232e7958b24d" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" Get Live Count- Java SDK<br/><br/> Get Live Count- Node.js SDK<br/><br/> Get Live Count- Python SDK -------------------------------------------------------------------------------- title: "Get Token Pair" description: "This API generates a token pair for a Datastream channel. The token pair is required to establish a WebSocket connection for any specific client or application to subscribe to the channel." last_updated: "2026-10-08T06:47:52.546Z" source: "https://docs.catalyst.zoho.com/en/api/code-reference/cloud-scale/data-streams/get-token-pair/" service: "Cloud Scale" -------------------------------------------------------------------------------- # Get Token Pair ### Description This API generates a token pair for a Datastream channel. The token pair is required to establish a WebSocket connection for any specific client or application to subscribe to the channel. Note: app_user_id is the unique identifier of an application user in your Catalyst project. You can obtain the value of app_user_id from Catalyst Authentication, which represents who is subscribing to the Data Streams channel. Check out this page for more details. ### Request Details #### Request URL <p>{api-domain}/baas/v1/project/{project_id}/datastreams/channel/{channel_id}/tokenpair</p> The DC-specific domain used to access Catalyst APIs The unique ID of the Catalyst project The unique ID of the Datastream channel <br> #### Request Headers **Authorization:** Zoho-oauthtoken {oauth_token}<br> **Content-Type:** application/json **Optional Headers** <br> **CATALYST-ORG:** {org_id} **Environment:** Development #### Request Body The unique ID of the application user for whom the token pair is generated #### Scope ZohoCatalyst.datastreams.connections.token.CREATE ### Response Details On successful execution, the response returns a token pair that can be used by the specified application user to establish a WebSocket connection and subscribe to the Datastream channel. curl -X POST \ https://api.catalyst.zoho.com/baas/v1/project/20084000000589014/datastreams/channel/20084000000662015/tokenpair \ -H "Authorization: Zoho-oauthtoken 1000.06adcc79fa822856dc0668e88d297d45.252b0f4d750669be5965252623d40004" \ -H "CATALYST-ORG: 89773766" \ -H "Environment: Development" \ -H "Content-Type: application/json" \ -d '{ "app_user_id": 20084000000888047 }' Generate Token Pair- Java SDK<br/><br/> Generate Token Pair- Node.js SDK<br/><br/> Generate Token Pair- Python SDK --- ## SDK — Java — Data Streams -------------------------------------------------------------------------------- title: "Get Component Instance" description: "This page describes the method to create an instance of the Data Streams component in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.553Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/get-component-instance/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Component Instance Catalyst Data Streams lets you publish live, event-based data through channels and deliver it instantly to subscribed clients. You can create an instance of the Data Streams component to access all channel-level operations such as listing channels, publishing data, and generating WebSocket tokens. You must first create a Data Streams instance using the getInstance() method to perform any Data Streams operations. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); -------------------------------------------------------------------------------- title: "Get Channels" description: "This page describes the methods to retrieve all channels or specific channel details from Catalyst Data Streams in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.553Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/get-channels/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Channels Catalyst Data Streams allows you to retrieve information about channels created in your project. You can fetch a list of all channels or get detailed information about a specific channel. ### Get All Channels This method fetches the list of all Data Streams channels that are created in the project using the getAllChannels() method. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCChannelDetails; import java.util.List; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Get all channels List<ZCChannelDetails> channels = datastream.getAllChannels(); ### Get Channel Details This method retrieves the metadata and configuration details of a specific channel by passing the channel ID to the getChannelDetails() method. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCChannelDetails; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Get channel details by channel ID ZCChannelDetails channelDetails = datastream.getChannelDetails("CHANNEL_ID"); -------------------------------------------------------------------------------- title: "Generate Token Pair" description: "This page describes the methods to generate WebSocket access tokens for subscribers in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.553Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/generate-token-pair/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Generate Token Pair Before a client can subscribe to a Data Streams channel, it must obtain a token pair to authenticate the WebSocket connection. The token pair can be generated using either a user ID or a connection name. You can generate the token pair in two ways as described in this section. ### Get Token Pair using User ID This method generates a token pair by passing the channel ID and the user ID to the getTokenPair() method. The user ID represents the unique identifier of the application user who is subscribing to the channel. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCTokenResponse; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Define channel ID and user ID String channelId = "CHANNEL_ID"; Long userId = 30772000000631094L; //Generate token pair using user ID ZCTokenResponse tokenResponse = datastream.getTokenPair(channelId, userId); ### Get Token Pair using Connection Name This method generates a token pair by passing the channel ID and a connection name to the getTokenPair() method. The connection name is a custom identifier for the subscriber connection. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCTokenResponse; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Define channel ID and connection name String channelId = "CHANNEL_ID"; String connectionName = "CONNECTION_NAME"; //Generate token pair using connection name ZCTokenResponse tokenResponse = datastream.getTokenPair(channelId, connectionName); -------------------------------------------------------------------------------- title: "Get Live Count" description: "This page describes the method to retrieve the number of active subscribers connected to a Data Streams channel in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.554Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/get-live-count/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Live Count Catalyst Data Streams allows you to track the number of active subscribers currently connected to a specific channel. This is useful for monitoring channel activity and implementing conditional logic based on subscriber presence. You can retrieve the live subscriber count by passing the channel ID to the getLiveCount() method. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCChannelLiveCountResponse; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Get the live subscriber count for a channel ZCChannelLiveCountResponse liveCount = datastream.getLiveCount("CHANNEL_ID"); -------------------------------------------------------------------------------- title: "Publish Data" description: "This page describes the method to publish real-time data to a Data Streams channel in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.554Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/publish-data/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Publish Data Catalyst Data Streams 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. You can publish data to a channel by passing the channel ID and the data payload to the publishData() method. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Publish a message to the channel Boolean resp = datastream.publishData( "11365000000413001", "Hey! Welcome to Zoho DataStreams!" ); -------------------------------------------------------------------------------- title: "WebSocket Connection" description: "This page describes how to connect to a Data Streams channel over WebSocket and subscribe to real-time data in your Java application with sample code snippets." last_updated: "2026-10-08T06:47:52.554Z" source: "https://docs.catalyst.zoho.com/en/sdk/java/v1/cloud-scale/data-streams/websocket-connection/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # WebSocket Connection Catalyst Data Streams enables clients to receive real-time data by establishing a WebSocket connection to a channel. The client listens for published messages and processes them as they are received. To subscribe to a channel, you must first generate a token pair, then create a WebSocket client with the token credentials, and finally add event listeners to handle incoming messages. #### Sample Code Snippet <br> import com.zc.component.datastream.ZCDatastream; import com.zc.component.datastream.beans.ZCCustomEvent; import com.zc.component.datastream.beans.ZCDataStreamMessageEvent; import com.zc.component.datastream.beans.ZCDataStreamsConfig; import com.zc.component.datastream.beans.ZCTokenResponse; import com.zc.component.datastream.websocket.ZCDataStreamsEventListener; import com.zc.component.datastream.websocket.ZCDataStreamsWebSocket; //Create a Data Streams instance ZCDatastream datastream = ZCDatastream.getInstance(); //Define channel ID and user ID String channelId = "30772000000631098"; Long userId = 30772000000631094L; //Generate token pair ZCTokenResponse tokenResponse = datastream.getTokenPair(channelId, userId); //Extract token credentials String key = tokenResponse.getKey(); String zuid = tokenResponse.getWssId(); String url = tokenResponse.getUrl(); //Create WebSocket configuration ZCDataStreamsConfig config = new ZCDataStreamsConfig( url, zuid, key, false ); //Create WebSocket client ZCDataStreamsWebSocket webSocketClient = datastream.createWebSocketClient(config); //Add event listener to handle WebSocket events webSocketClient.addEventListener(new ZCDataStreamsEventListener() { @Override public void onOpen(ZCCustomEvent event) { //Subscribe after WebSocket opens webSocketClient.subscribe("-2"); } @Override public void onMessage(ZCDataStreamMessageEvent event) { //Handle event payload or bulk URL info if (event.getData() != null) { System.out.println("Data: " + event.getData()); } else if (event.getUrl() != null && event.getMethod() != null) { System.out.println("API URL: " + event.getUrl()); System.out.println("Method: " + event.getMethod()); } //Acknowledge to receive the next message webSocketClient.sendAck(); } @Override public void onClose(ZCCustomEvent event) { System.out.println("Closed: " + event.getMessage()); } @Override public void onError(ZCCustomEvent event) { //Log error System.err.println("Error: " + event.getMessage()); } @Override public void onPong(ZCCustomEvent event) { System.out.println("Pong: " + event.getMessage()); } }); <br> ### WebSocket Client Methods The ZCDataStreamsWebSocket client provides the following methods to manage the WebSocket connection and subscription. <table class="content-table"> <thead> <tr> <th class="w30p">Method</th> <th class="w70p">Description</th> </tr> </thead> <tbody> <tr> <td>subscribe(String subscribeType)</td> <td>Subscribes to the channel with the specified subscribe type. Throws ZCDataStreamException.</td> </tr> <tr> <td>subscribe()</td> <td>Subscribes to the channel with the default subscribe type. Throws ZCDataStreamException.</td> </tr> <tr> <td>unsubscribe()</td> <td>Unsubscribes from the channel. Throws ZCDataStreamException.</td> </tr> <tr> <td>sendAck()</td> <td>Sends an acknowledgement to receive the next streaming data.</td> </tr> <tr> <td>close()</td> <td>Closes the WebSocket connection manually.</td> </tr> <tr> <td>isConnected()</td> <td>Returns whether the connection is currently open, as a boolean.</td> </tr> <tr> <td>getConnectionState()</td> <td>Returns the current connection state as a String.</td> </tr> <tr> <td>getSessionInfo()</td> <td>Returns the ZCSessionInfo of the active session.</td> </tr> </tbody> </table> --- ## SDK — Modular JavaScript SDK — Data Streams -------------------------------------------------------------------------------- title: "Get Data Streams Instance" description: "This page describes the method to create a Data Streams component instance in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.555Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/get-component-instance/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Catalyst Data Streams Catalyst Data Streams enables you to publish live, event-based data through channels and deliver it instantly to subscribed clients or any third-party services. Once you create a channel from the Catalyst console, any published data to that channel is streamed in real time to all authorized subscribers over WebSocket connections. Whether you are building live dashboards, notifications, activity feeds, or system monitors, Catalyst SDK provides you with the required APIs to publish, subscribe, and manage real-time data flow with minimal setup. #### Install and Import the SDK You must install the Data Streams package and import the required classes as shown below. const { DataStreams, DataStreamsWebSocket } = require("@zcatalyst/datastreams"); #### Get Component Instance You can create a datastreams reference as shown below. This will not fire a server-side call. We will refer to this component instance while performing channel operations such as listing channels, publishing data, and generating WebSocket tokens. //Create a Data Streams instance const datastreams = new DataStreams(); -------------------------------------------------------------------------------- title: "Get Channels" description: "This page describes the methods to retrieve all channels or specific channel details from Data Streams in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.555Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/get-channels/" service: "Cloud Scale" related: - Get Channels - API (/en/api/code-reference/cloud-scale/data-streams/get-all-channels) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Channels You can retrieve information about the Data Streams channels created in your project. This includes fetching a list of all channels or obtaining detailed metadata and configuration for a specific channel. The datastreams reference used in the code below is the component instance created earlier. ### Get All Channels You can fetch the list of all Data Streams channels that are created in the project using the getAllChannels() method. The promise returned here will be resolved to an array of channel objects. //Get all channels const channels = await datastreams.getAllChannels(); ### Get Channel Details You can retrieve the metadata and configuration details of a specific channel by passing the channel ID to the getChannelDetails() method. The promise returned here will be resolved to a channel object containing the channel's configuration. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> //Get channel details by channel ID const channel = await datastreams.getChannelDetails(CRICKET_CHANNEL_ID); -------------------------------------------------------------------------------- title: "Generate Token Pair" description: "This page describes the methods to generate WebSocket access tokens for subscribers in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.555Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/generate-token-pair/" service: "Cloud Scale" related: - Get Token Pair - API (/en/api/code-reference/cloud-scale/data-streams/get-token-pair) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Generate Token Pair Before a client can subscribe to a Data Streams channel, it must obtain a token pair to authenticate the WebSocket connection. The token pair can be generated using either a user ID or a connection name. You can generate the token pair in two ways as described in this section. The datastreams reference used in the code below is the component instance created earlier. ### Get Token Pair using Connection Name You can generate a token pair by passing the channel ID and a connection name to the getTokenPair() method. The connection name is a custom identifier for the subscriber connection. The promise returned here will be resolved to a token pair object. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>connectionName</td> <td>String</td> <td>A Mandatory parameter. Holds the custom identifier for the subscriber connection.</td> </tr> </tbody> </table> //Generate token pair using connection name const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { connectionName: "cricketScoreUpdates" }); ### Get Token Pair using User ID Alternatively, you can generate a token pair by passing the channel ID and the user ID to the getTokenPair() method. The user ID represents the unique identifier of the application user who is subscribing to the channel. The promise returned here will be resolved to a token pair object. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>userId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the user subscribing to the channel.</td> </tr> </tbody> </table> //Generate token pair using user ID const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { userId: "userId" }); -------------------------------------------------------------------------------- title: "Get Live Count" description: "This page describes the method to retrieve the number of active subscribers connected to a Data Streams channel in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.556Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/get-live-count/" service: "Cloud Scale" related: - Get Live Count - API (/en/api/code-reference/cloud-scale/data-streams/get-live-count) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Live Count Catalyst Data Streams allows you to track the number of active subscribers currently connected to a specific channel. This is useful for monitoring channel activity and implementing conditional logic based on subscriber presence. The datastreams reference used in the code below is the component instance created earlier. ### Track Active Subscribers You can retrieve the live subscriber count by passing the channel ID to the getLiveCount() method. The promise returned here will be resolved to an object containing the count of active subscribers. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> //Get the live subscriber count for a channel const liveCount = await datastreams.getLiveCount(CRICKET_CHANNEL_ID); -------------------------------------------------------------------------------- title: "Publish Data" description: "This page describes the method to publish real-time data to a Data Streams channel in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.556Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/publish-data/" service: "Cloud Scale" related: - Publish Data - API (/en/api/code-reference/cloud-scale/data-streams/publish-data) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Publish Data Catalyst Data Streams 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 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** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>data</td> <td>Object</td> <td>A Mandatory parameter. Holds the data payload to be published to the channel.</td> </tr> </tbody> </table> //Publish data to all subscribers of the channel const publishRes = await datastreams.publishData(CRICKET_CHANNEL_ID, "Hello, subscribers!"); -------------------------------------------------------------------------------- title: "WebSocket Connection" description: "This page describes how to connect to a Data Streams channel over WebSocket and subscribe to real-time data in your web application with sample code snippets." last_updated: "2026-10-08T06:47:52.556Z" source: "https://docs.catalyst.zoho.com/en/sdk/javascript/v1/cloudscale/data-streams/websocket-connection/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # WebSocket Connection Catalyst Data Streams enables clients to receive real-time data by establishing a WebSocket connection to a channel. The client listens for published messages and processes them as they are received. To subscribe to a channel, you must first generate a token pair, then create a WebSocket client with the token credentials, and finally set event handlers to handle incoming messages. The datastreams reference used in the code below is the component instance created earlier. ### Establish WebSocket Connection You must initially generate a token pair using the getTokenPair() method as shown below. Then, create a WebSocket client by passing the token credentials to the DataStreamsWebSocket constructor. Note: * CRICKET_CHANNEL_ID - Replace with your actual Channel ID which you can get from Dashboard → General Details section. * userId - A unique identifier used to generate WebSocket credentials for that subscriber. * subscribe("0") - This subscribes the client to live data. //Generate token pair const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { userId: "userId" }); //Create WebSocket client const socket = new DataStreamsWebSocket({ url: response.url, zuid: response["wss-id"], key: response.key, enableLogging: true }); //Handling WebSocket events socket.on("open", () => { console.log("WebSocket connection opened"); socket.subscribe("0"); //Subscribe to live data }); socket.on("message", (data) => { console.log("WebSocket message received:", data); socket.sendAck(); //Acknowledge to receive next message }); socket.on("error", (error) => { console.error("WebSocket error:", error); }); socket.on("close", () => { console.log("WebSocket connection closed"); }); <br> ### WebSocket Client Methods The DataStreamsWebSocket client provides the following methods to manage the WebSocket connection and subscription. <table class="content-table"> <thead> <tr> <th class="w30p">Method</th> <th class="w70p">Description</th> </tr> </thead> <tbody> <tr> <td>subscribe()</td> <td>Subscribes to the channel with the specified subscribe type: live, earliest, resume, or a specific streaming ID.</td> </tr> <tr> <td>unsubscribe()</td> <td>Unsubscribes from the channel.</td> </tr> <tr> <td>sendAck()</td> <td>Sends an acknowledgement to receive the next streaming data.</td> </tr> <tr> <td>close()</td> <td>Closes the WebSocket connection.</td> </tr> <tr> <td>isConnected()</td> <td>Checks whether the connection is currently open.</td> </tr> <tr> <td>getConnectionState()</td> <td>Returns the current connection state: connected, connecting, closing, or closed.</td> </tr> <tr> <td>getSessionInfo()</td> <td>Returns the session ID and user ID of the current session.</td> </tr> </tbody> </table> --- ## SDK — Node JS — Data Streams -------------------------------------------------------------------------------- title: "Get Data Streams Instance" description: "This page describes the method to create a Data Streams component instance in your Node.js application with sample code snippets." last_updated: "2026-10-08T06:47:52.557Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/get-component-instance/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Catalyst Data Streams Catalyst Data Streams enables you to publish live, event-based data through channels and deliver it instantly to subscribed clients or any third-party services. Once you create a channel from the Catalyst console, any published data to that channel is streamed in real time to all authorized subscribers over WebSocket connections. Whether you are building live dashboards, notifications, activity feeds, or system monitors, Catalyst SDK provides you with the required APIs to publish, subscribe, and manage real-time data flow with minimal setup. #### Install and Import the SDK You must install the Data Streams package and import the required classes as shown below. const { DataStreams, DataStreamsWebSocket } = require("@zcatalyst/datastreams"); #### Get Component Instance You can create a datastreams reference as shown below. This will not fire a server-side call. We will refer to this component instance while performing channel operations such as listing channels, publishing data, and generating WebSocket tokens. //Create a Data Streams instance const datastreams = new DataStreams(); -------------------------------------------------------------------------------- title: "Get Channels" description: "This page describes the methods to retrieve all channels or specific channel details from Data Streams in your Node.js application with sample code snippets." last_updated: "2026-10-08T06:47:52.557Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/get-channels/" service: "Cloud Scale" related: - Get Channels - API (/en/api/code-reference/cloud-scale/data-streams/get-all-channels) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Channels You can retrieve information about the Data Streams channels created in your project. This includes fetching a list of all channels or obtaining detailed metadata and configuration for a specific channel. The datastreams reference used in the code below is the component instance created earlier. ### Get All Channels You can fetch the list of all Data Streams channels that are created in the project using the getAllChannels() method. The promise returned here will be resolved to an array of channel objects. //Get all channels const channels = await datastreams.getAllChannels(); ### Get Channel Details You can retrieve the metadata and configuration details of a specific channel by passing the channel ID to the getChannelDetails() method. The promise returned here will be resolved to a channel object containing the channel's configuration. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> //Get channel details by channel ID const channel = await datastreams.getChannelDetails(CRICKET_CHANNEL_ID); -------------------------------------------------------------------------------- title: "Generate Token Pair" description: "This page describes the methods to generate WebSocket access tokens for subscribers in your Node.js application with sample code snippets." last_updated: "2026-10-08T06:47:52.558Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/generate-token-pair/" service: "Cloud Scale" related: - Get Token Pair - API (/en/api/code-reference/cloud-scale/data-streams/get-token-pair) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Generate Token Pair Before a client can subscribe to a Data Streams channel, it must obtain a token pair to authenticate the WebSocket connection. The token pair can be generated using either a user ID or a connection name. You can generate the token pair in two ways as described in this section. The datastreams reference used in the code below is the component instance created earlier. ### Get Token Pair using Connection Name You can generate a token pair by passing the channel ID and a connection name to the getTokenPair() method. The connection name is a custom identifier for the subscriber connection. The promise returned here will be resolved to a token pair object. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>connectionName</td> <td>String</td> <td>A Mandatory parameter. Holds the custom identifier for the subscriber connection.</td> </tr> </tbody> </table> //Generate token pair using connection name const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { connectionName: "cricketScoreUpdates" }); ### Get Token Pair using User ID Alternatively, you can generate a token pair by passing the channel ID and the user ID to the getTokenPair() method. The user ID represents the unique identifier of the application user who is subscribing to the channel. The promise returned here will be resolved to a token pair object. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>userId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the user subscribing to the channel.</td> </tr> </tbody> </table> //Generate token pair using user ID const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { userId: "userId" }); -------------------------------------------------------------------------------- title: "Get Live Count" description: "This page describes the method to retrieve the number of active subscribers connected to a Data Streams channel in your Node.js application with sample code snippets." last_updated: "2026-10-08T06:47:52.558Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/get-live-count/" service: "Cloud Scale" related: - Get Live Count - API (/en/api/code-reference/cloud-scale/data-streams/get-live-count) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Get Live Count Catalyst Data Streams allows you to track the number of active subscribers currently connected to a specific channel. This is useful for monitoring channel activity and implementing conditional logic based on subscriber presence. The datastreams reference used in the code below is the component instance created earlier. ### Track Active Subscribers You can retrieve the live subscriber count by passing the channel ID to the getLiveCount() method. The promise returned here will be resolved to an object containing the count of active subscribers. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> //Get the live subscriber count for a channel const liveCount = await datastreams.getLiveCount(CRICKET_CHANNEL_ID); -------------------------------------------------------------------------------- title: "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-10-08T06:47:52.558Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/publish-data/" service: "Cloud Scale" related: - Publish Data - API (/en/api/code-reference/cloud-scale/data-streams/publish-data) - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # Publish Data Catalyst Data Streams 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 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** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channelId</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>data</td> <td>Object</td> <td>A Mandatory parameter. Holds the data payload to be published to the channel.</td> </tr> </tbody> </table> //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() }); -------------------------------------------------------------------------------- title: "WebSocket Connection" description: "This page describes how to connect to a Data Streams channel over WebSocket and subscribe to real-time data in your Node.js application with sample code snippets." last_updated: "2026-10-08T06:47:52.558Z" source: "https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/data-streams/websocket-connection/" service: "Cloud Scale" related: - Data Streams (/en/cloud-scale/help/data-streams/introduction) -------------------------------------------------------------------------------- # WebSocket Connection Catalyst Data Streams enables clients to receive real-time data by establishing a WebSocket connection to a channel. The client listens for published messages and processes them as they are received. To subscribe to a channel, you must first generate a token pair, then create a WebSocket client with the token credentials, and finally set event handlers to handle incoming messages. The datastreams reference used in the code below is the component instance created earlier. ### Establish WebSocket Connection You must initially generate a token pair using the getTokenPair() method as shown below. Then, create a WebSocket client by passing the token credentials to the DataStreamsWebSocket constructor. Note: * CRICKET_CHANNEL_ID - Replace with your actual Channel ID which you can get from Dashboard → General Details section. * userId - A unique identifier used to generate WebSocket credentials for that subscriber. * subscribe("0") - This subscribes the client to live data. //Generate token pair const response = await datastreams.getTokenPair(CRICKET_CHANNEL_ID, { userId: "userId" }); //Create WebSocket client const socket = new DataStreamsWebSocket({ url: response.url, zuid: response["wss-id"], key: response.key, enableLogging: true }); //Handling WebSocket events socket.on("open", () => { console.log("WebSocket connection opened"); socket.subscribe("0"); //Subscribe to live data }); socket.on("message", (data) => { console.log("WebSocket message received:", data); socket.sendAck(); //Acknowledge to receive next message }); socket.on("error", (error) => { console.error("WebSocket error:", error); }); socket.on("close", () => { console.log("WebSocket connection closed"); }); --- ## SDK — Python — Data Streams -------------------------------------------------------------------------------- title: "Get Component Instance" description: "This page describes the method to create an instance of the Data Streams component in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.559Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/get-component-instance/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Get Component Instance Catalyst Data Streams lets you publish live, event-based data through channels and deliver it instantly to subscribed clients. You can create an instance of the Data Streams component to access all channel-level operations such as listing channels, publishing data, and generating WebSocket tokens. You must first create a Data Streams instance using the datastreams() method to perform any Data Streams operations. The initialize_app() method requires valid Catalyst credentials and app options from credential file or environment variables. import zcatalyst_sdk # Initialize SDK (reads credentials + project options) app_sdk = zcatalyst_sdk.initialize_app() # Get the Datastreams component data_streams = app_sdk.datastreams() -------------------------------------------------------------------------------- title: "Get Channels" description: "This page describes the methods to retrieve all channels or specific channel details from Catalyst Data Streams in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.560Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/get-channels/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Get Channels Catalyst Data Streams allows you to retrieve information about channels created in your project. You can fetch a list of all channels or get detailed information about a specific channel. The data_streams reference used in the below code snippets is the component instance created earlier. To know more about this instance, please refer to this section. ### Get All Channels This method fetches the list of all Data Streams channels that are created in the project using the get_all_channels() method. # Get all channels (admin) channels = data_streams.get_all_channels() ### Get Channel Details This method retrieves the metadata and configuration details of a specific channel by passing the channel ID to the get_channel_details() method. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channel_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> # Get channel details channel = data_streams.get_channel_details("CHANNEL_ID") -------------------------------------------------------------------------------- title: "Generate Token Pair" description: "This page describes the methods to generate WebSocket access tokens for subscribers in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.560Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/generate-token-pair/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Generate Token Pair Before a client can subscribe to a Data Streams channel, it must obtain a token pair to authenticate the WebSocket connection. The token pair can be generated using either a user ID or a connection name. You can generate the token pair in two ways as described in this section. The data_streams reference used below is the component instance created earlier. To know more about this instance, please refer to this section. ### Get Token Pair using User ID This method generates a token pair by passing the channel ID and the user ID to the get_token_pair() method. The user ID represents the unique identifier of the application user who is subscribing to the channel. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channel_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>user_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the user subscribing to the channel.</td> </tr> </tbody> </table> # Get token pair using user id token_by_user = data_streams.get_token_pair("CHANNEL_ID", user_id="USER_ID") ### Get Token Pair using Connection Name This method generates a token pair by passing the channel ID and a connection name to the get_token_pair() method. The connection name is a custom identifier for the subscriber connection. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channel_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>connection_name</td> <td>String</td> <td>A Mandatory parameter. Holds the custom identifier for the subscriber connection.</td> </tr> </tbody> </table> # Get token pair using connection name token_by_connection = data_streams.get_token_pair("CHANNEL_ID", connection_name="CONNECTION_NAME") -------------------------------------------------------------------------------- title: "Get Live Count" description: "This page describes the method to retrieve the number of active subscribers connected to a Data Streams channel in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.560Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/get-live-count/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Get Live Count Catalyst Data Streams allows you to track the number of active subscribers currently connected to a specific channel. This is useful for monitoring channel activity and implementing conditional logic based on subscriber presence. You can retrieve the live subscriber count by passing the channel ID to the get_live_count() method. The data_streams reference used below is the component instance created earlier. To know more about this instance, please refer to this section. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channel_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> </tbody> </table> # Get live count (active subscribers) live_count = data_streams.get_live_count("CHANNEL_ID") -------------------------------------------------------------------------------- title: "Publish Data" description: "This page describes the method to publish real-time data to a Data Streams channel in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.560Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/publish-data/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # Publish Data Catalyst Data Streams 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. You can publish data to a channel by passing the channel ID and the data payload to the publish_data() method. The data_streams reference used below is the component instance created earlier. To know more about this instance, please refer to this section. **Parameters Used** <table class="content-table"> <thead> <tr> <th class="w20p">Parameter Name</th> <th class="w20p">Data Type</th> <th class="w60p">Definition</th> </tr> </thead> <tbody> <tr> <td>channel_id</td> <td>String</td> <td>A Mandatory parameter. Holds the unique ID of the channel.</td> </tr> <tr> <td>data</td> <td>Object</td> <td>A Mandatory parameter. Holds the data payload to be published to the channel.</td> </tr> </tbody> </table> # Publish a message to all subscribers of the channel publish_response = data_streams.publish_data("CHANNEL_ID", "Hello, subscribers!") -------------------------------------------------------------------------------- title: "WebSocket Connection" description: "This page describes how to connect to a Data Streams channel over WebSocket and subscribe to real-time data in your Python application with sample code snippets." last_updated: "2026-10-08T06:47:52.560Z" source: "https://docs.catalyst.zoho.com/en/sdk/python/v1/cloud-scale/data-streams/websocket-connection/" service: "Cloud Scale" related: - Data Streams Help (/en/cloud-scale/help/data-streams/introduction) - SDK Scopes (/en/sdk/python/v1/sdk-scopes) -------------------------------------------------------------------------------- # WebSocket Connection Catalyst Data Streams enables clients to receive real-time data by establishing a WebSocket connection to a channel. The client listens for published messages and processes them as they are received. To subscribe to a channel, you must first generate a token pair, then create a WebSocket client with the token credentials, and finally set event handlers to handle incoming messages. ## Connect and Subscribe import zcatalyst_sdk from zcatalyst_sdk.datastreams.websocket_client import DataStreamsWebSocket from zcatalyst_sdk.types.datastreams import DataStreamsConfig # Initialize SDK app_sdk = zcatalyst_sdk.initialize_app() data_streams = app_sdk.datastreams() # Get token pair (required to authenticate WebSocket) token = data_streams.get_token_pair("CHANNEL_ID", user_id="USER_ID") # Create WebSocket config config = DataStreamsConfig( url=token["url"], zuid=token["wss-id"], key=token["key"], enable_logging=True, ) # Create WebSocket client websocket_client = DataStreamsWebSocket(config=config) def on_open(event): # Subscribe after connection is established websocket_client.subscribe("0") def on_message(event): # event.data: inline payload # event.url + event.method: bulk payload retrieval info print("streaming_id:", event.streaming_id) print("data:", event.data) print("url:", event.url) print("method:", event.method) # Acknowledge to receive the next message websocket_client.send_ack() def on_error(event): # CustomEvent with code/message/data print("error:", event.code, event.message, event.data) def on_close(event): # Close details (if any) print("closed:", event) websocket_client.set_on_open(on_open) websocket_client.set_on_message(on_message) websocket_client.set_on_error(on_error) websocket_client.set_on_close(on_close) # Connect (runs WebSocket in a background thread) websocket_client.connect() <br> ## WebSocket Client Methods The DataStreamsWebSocket client provides the following methods to manage the WebSocket connection and subscription. <table class="content-table"> <thead> <tr> <th class="w30p">Method</th> <th class="w70p">Description</th> </tr> </thead> <tbody> <tr> <td>connect()</td> <td>Establishes the WebSocket connection. The connection runs in a background thread.</td> </tr> <tr> <td>subscribe(subscribe_type="0")</td> <td>Subscribes to the channel with the specified subscribe type. Defaults to "0" (live data).</td> </tr> <tr> <td>unsubscribe()</td> <td>Unsubscribes from the channel.</td> </tr> <tr> <td>send_ack()</td> <td>Sends an acknowledgement to receive the next streaming data.</td> </tr> <tr> <td>close()</td> <td>Closes the WebSocket connection.</td> </tr> <tr> <td>is_connected()</td> <td>Returns whether the connection is currently open, as a bool.</td> </tr> <tr> <td>get_connection_state()</td> <td>Returns the current ConnectionState.</td> </tr> <tr> <td>get_session_info()</td> <td>Returns the session information as a Dict[str, str].</td> </tr> </tbody> </table>