webiny-admin-websockets-catalog

Catalogs the WebsocketEventHandler abstraction for handling incoming websocket messages in Webiny admin apps.

8.0k|673|Updated Jan 9, 2018
One-click install
npx skills add https://github.com/webiny/webiny-js --skill webiny-admin-websockets-catalog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: webiny-admin-websockets-catalog
Source: https://github.com/webiny/webiny-js/tree/main/skills/user-skills/generated/admin/websockets
Command: npx skills add https://github.com/webiny/webiny-js --skill webiny-admin-websockets-catalog

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers extending the Webiny admin application need a discoverable reference for the websocket event handling abstraction, including its exact import path, source location, and usage contract, without searching the monorepo manually.

Core Features & Use Cases

  • Abstraction Catalog: Documents the WebsocketEventHandler abstraction with its import statement (webiny/admin/websockets) and source file (@webiny/app-websockets/events/abstractions.ts).
  • Usage Guidance: Explains that registered handlers receive every incoming websocket message published as a WebsocketEvent and must filter by event.payload.action.
  • Use Case: When building a custom admin extension that reacts to real-time websocket events, look up this catalog to get the correct abstraction, then read the source file for exact types before implementing your handler.

Quick Start

Ask the assistant to show the WebsocketEventHandler abstraction from the admin websockets catalog and explain how to register a handler that filters events by payload action.

Frequently Asked Questions about webiny-admin-websockets-catalog

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle websocket events in a Webiny admin app?

Register a handler against the WebsocketEventHandler abstraction imported from webiny/admin/websockets. Your handler receives every incoming websocket message as a WebsocketEvent and should filter by event.payload.action to react only to relevant messages.

Where is the WebsocketEventHandler abstraction defined in Webiny?

It is defined in @webiny/app-websockets at events/abstractions.ts. Read that source file to get the exact interface and types before implementing your handler.

Does WebsocketEventHandler receive all websocket messages or only specific ones?

It receives every incoming websocket message, since the websockets to EventPublisher bridge publishes all messages as WebsocketEvent objects. Each handler is responsible for filtering by event.payload.action instead of subscribing to the websocket service directly.

Should I subscribe to the websocket service directly instead of using WebsocketEventHandler?

No. The documented pattern is to register a WebsocketEventHandler and filter events by payload action. Direct subscription to the websocket service bypasses the EventPublisher bridge and is not the intended extension point.