Przejdź do treści
Biblioteka skilli
Programowanie · Integracja z narzędziem

catalyst-datastreams

/catalyst-datastreams

Opisuje kanały publikuj i subskrybuj w czasie rzeczywistym przez WebSocket w Catalyst, z tokenami dostępu i kontrolą uprawnień.

Repozytorium
agent-skills ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
28.10.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
5
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 28.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Opisuje kanały publikuj i subskrybuj w czasie rzeczywistym przez WebSocket w Catalyst, z tokenami dostępu i kontrolą uprawnień.

Wyzwalacze z opisu

Data Streamsdatastreamsreal-time channellive updatespub/subWebSocket subscribertoken pairwss-id
Oryginalny opis (EN)

Catalyst Data Streams — real-time publish/subscribe channels over WebSocket. Publish from a function with publishData / publish_data, issue a token pair with getTokenPair / get_token_pair, subscribe with DataStreamsWebSocket / ZCDataStreamsWebSocket (Node.js, browser, Java, Python), sendAck, live/earliest/resume subscribe types, 48-hour retention, User Roles vs Custom Logic access control. Trigger on 'Data Streams', 'datastreams', 'real-time channel', 'live updates', 'pub/sub', 'WebSocket subscriber', 'token pair', 'wss-id', 'app_user_id is missing', 'Invalid access control source', 'Authentic

Jak działa

  1. How It Works
  2. Security Checklist
  3. Triggers
  4. References
Sekcje z nagłówków SKILL.md, w oryginale · 39 linii, 767 słów
Podgląd SKILL.md
---
name: catalyst-datastreams
description: "Catalyst Data Streams — real-time publish/subscribe channels over WebSocket. Publish from a function with publishData / publish_data, issue a token pair with getTokenPair / get_token_pair, subscribe with DataStreamsWebSocket / ZCDataStreamsWebSocket (Node.js, browser, Java, Python), sendAck, live/earliest/resume subscribe types, 48-hour retention, User Roles vs Custom Logic access control. Trigger on 'Data Streams', 'datastreams', 'real-time channel', 'live updates', 'pub/sub', 'WebSocket subscriber', 'token pair', 'wss-id', 'app_user_id is missing', 'Invalid access control source', 'Authentication failed 3000', '@zcatalyst/datastreams', or 'zcatalyst_sdk.datastreams'."
metadata:
  version: "2.0.0"
---

## How It Works

1. **Channels and access control are console-only.** Create the channel and choose its access control in Console → Cloud Scale → Data Streams; no SDK, REST, or MCP tool creates channels. Ask the user for the channel ID and its access control type, or list channels with `getAllChannels()` (`control_type` 0 = User Roles, 1 = Custom Logic). Load `references/datastreams-basics.md` for concepts, the token rules, subscribe types, acknowledgement, and the REST API.

2. **Pick the token identifier from the access control — it is not interchangeable.**
   - **User Roles** → `userId` = an app user's ID from Catalyst Authentication. A console admin's user ID is rejected; `connectionName` fails with "Mandatory parameter app_user_id is missing."
   - **Custom Logic** → `connectionName`, and the token must be generated **inside the Advanced I/O function selected as the channel's access control**. That function is the token endpoint: it runs your check, then calls `getTokenPair`. Catalyst never calls it on its own. From any other function or REST: "Invalid access control source!". User-ID tokens on these channels are issued but the WebSocket rejects them (`3000`).

3. **Server code (publish, token pair, channel reads) — load the runtime reference.**
   - Node.js / JavaScript → `references/datastreams-javascript-basics.md`. Initialize with the app: `new DataStreams(await zcAuth.init(req))`. Advanced I/O handlers get Node's raw `req`/`res`: no `req.body`, `res.status()`, or `res.json()`.
   - Python → `references/datastreams-python-basics.md`. Requires `zcatalyst-sdk` 1.5.0+ (Python 3.10+). `app = zcatalyst_sdk.initialize(req=request)`, then `app.datastreams()` (plural). Pass `get_token_pair` a **string** channel ID and a keyword `user_id=` / `connection_name=`; the result's keys are hyphenated (`token["wss-id"]`). The subscriber does nothing until `connect()`.
   - Java → `references/datastreams-java-basics.md`. Dependency is `com.zoho.catalyst:java-sdk` (2.5.0+) from `https://maven.zohodl.com`; no `datastreams` artifact exists.
   - `publishData`, `getAllChannels`, `getChannelDetails` and `getLiveCount` are **admin** methods: server only, never in browser or mobile code. `getTokenPair` also exists in the browser SDK, but a Custom Logic token must come from the configured function.

4. **Subscriber code — read the token correctly and always acknowledge.** The token pair's keys are hyphenated: pass `token['wss-id']` as `zuid`, plus `token.url` and `token.key`. Subscribe only after the `open` event. Call `sendAck()` after every message, or the next message is never delivered. Messages carry `data` (always a string) and `streamingId` (plus `url`/`method` on API-operation messages). To reconnect, release the old session (old token → `unsubscribe()`), take a fresh token, `subscribe('0')`, and reload state from your own store; resuming a dropped session with `'-2'` redelivers missed messages twice and replays the 48-hour retention. Unsubscribe before every deliberate close; the `error` event with code `1000` that follows your own `unsubscribe()` is expected. In Node, `getLiveCount()` returns `{ status, data: { connections } }`. Java: `subscribe()` throws the checked `ZCDataStreamException`, and outside a Catalyst function create the client with `new ZCDataStreamsWebSocket(config)`, not `ZCDatastream.getInstance()`.

5. **Verify end to end before reporting success.** Open a subscriber, check `getLiveCount()` shows it, publish a test message, and confirm the subscriber received it. For anything the references do not cover, fetch the page under <https://docs.catalyst.zoho.com/en/cloud-scale/help/data-streams/> as Markdown (`<page-url>/index.md`), and prefer the references where they disagree.

## Security Checklist

- `publishData` and the channel-read methods are admin operations: run them only in a Catalyst function, never in a browser or mobile app.
- Protect the token endpoint. Anyone who can call it can subscribe to the channel, so authenticate the caller before issuing a token.
- On Custom Logic channels, the configured function is the only gatekeeper: put the real validation there before calling `getTokenPair`.
- Do not log or return the token `key` anywhere except to the client that asked for it.

## Triggers

Use this skill for: "Data Streams", "Catalyst Data Streams", "datastreams", "real-time channel", "live updates", "push updates to the browser", "pub/sub", "publish data", `publishData`, `getTokenPair`, "token pair", "wss-id", `DataStreamsWebSocket`, `ZCDataStreamsWebSocket`, `ZCDatastream`, "WebSocket subscriber", `sendAck`, "subscribe type", "resume from last message", "live count", `getLiveCount`, "channel access control", "User Roles channel", "Custom Logic channel", "app_user_id is missing", "Invalid access control source", "Authentication failed 3000", "reconnect", "duplicate messages after reconnect", "DUPLICATE_VALUE", `@zcatalyst/datastreams`, `zcatalyst_sdk`, `get_token_pair`, `publish_data`, `send_ack`, or "Data Streams Python".

## References

| Reference | Load when the query is about… |
|-----------|-------------------------------|
| `references/datastreams-basics.md` | Concepts, channels, access control (User Roles vs Custom Logic), which token identifier to use, token pair shape, subscribe types, acknowledgement, retention, message fields, REST API endpoints and scopes |
| `references/datastreams-javascript-basics.md` | Node.js functions (init, publish, token endpoint, Custom Logic function, channel reads), Node and browser subscribers, package versions |
| `references/datastreams-python-basics.md` | Python functions and subscribers: `zcatalyst-sdk` 1.5.0+, `app.datastreams()`, `get_token_pair` argument rules, `DataStreamsWebSocket` with `connect()` and `set_on_*` callbacks, deploying Python functions |
| `references/datastreams-java-basics.md` | Java functions and subscribers: Maven setup, `ZCDatastream`, `ZCDataStreamsWebSocket`, checked exceptions, running outside Catalyst |
Pliki w paczce (5)
  • SKILL.md 7 KB
  • references/datastreams-basics.md 12 KB
  • references/datastreams-java-basics.md 8 KB
  • references/datastreams-javascript-basics.md 9 KB
  • references/datastreams-python-basics.md 9 KB

Wersje

W bazie nie ma innych skilli o nazwie catalyst-datastreams.

Migawka bazy z 13.11.2026 · wersja paczki 580e942bd8d2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90catalyst-sdk
    Opisuje wzorce inicjalizacji, dostęp do usług i metody SDK Catalyst dla Node.js, przeglądarki, Pythona, Javy, Androida, iOS i Flutter.
  • 95ave-data-wss
    Odbiera na żywo dane on-chain z WebSocket AVE Cloud: transakcje wymiany, płynność, świecę cenową i zmiany ceny wybranych tokenów.
  • 100building-websocket-server
    Buduje skalowalne serwery WebSocket do dwukierunkowej komunikacji w czasie rzeczywistym.
  • 100building-websocket-server
    Buduje skalowalne serwery WebSocket do dwukierunkowej komunikacji w czasie rzeczywistym.
  • 100react-websocket
    Opisuje integrację WebSocket w aplikacjach React: własne hooki, providery kontekstu, Socket.IO i synchronizacja stanu w czasie rzeczywistym z TanStack Query.
  • 100azure-messaging-webpubsubservice-py
    Obsługuje Azure Web PubSub Service SDK dla Pythona: komunikacja w czasie rzeczywistym, połączenia WebSocket i wzorce pub/sub.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.