Data Streams JavaScript SDK

Data Streams is a Catalyst CloudScale component that streams real-time, event-driven data from publishers to subscribers through channels. It follows a publish-subscribe model: data published to a channel reaches every subscribed client in real time over WebSocket connections.

The Data Streams JavaScript SDK package enables you to fetch the channels in your project, publish data to a channel, generate the token pair a subscriber needs to connect, track the number of active subscribers, and subscribe to a channel over WebSocket.

Prerequisites

You need to install the following package to be able to use the Data Streams SDK methods.

copy
$
npm install @zcatalyst/datastreams

Info: Ensure that you have applied the required authentication configuration to use the SDK methods of this component.

Import Requirement

You need to import the following modules to use the Data Streams SDK methods.

copy
const { DataStreams, DataStreamsWebSocket } = require('@zcatalyst/datastreams');//Data Streams modules

List of SDK Methods

The following table contains the list of SDK methods that can be used to perform Data Streams operations through code.

CategorySDK MethodRequired Scope
General OperationsGet Data Streams InstanceNot required
Channel OperationsGet ChannelsAdmin
Generate Token PairAdmin
Get Live CountAdmin
Publish DataAdmin
Subscriber OperationsWebSocket ConnectionNot required

Last Updated 2026-12-01 21:24:40 +0530 IST