serverpod-server-events

Publish and consume typed Serverpod events across named channels.

3.2k|369|Updated May 22, 2021
One-click install
npx skills add https://github.com/serverpod/serverpod --skill serverpod-server-events
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serverpod-server-events
Source: https://github.com/serverpod/serverpod/tree/main/packages/serverpod/skills/serverpod-server-events
Command: npx skills add https://github.com/serverpod/serverpod --skill serverpod-server-events

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serverpod developers need a reliable way to publish and consume typed events so that realtime features can coordinate state changes without tightly coupling components.

Core Features & Use Cases

  • Post messages on named channels: Send typed, serializable event models to interested consumers.
  • Consume events via streams or listeners: Receive updates either as a reactive stream or via callback listeners.
  • Local vs global delivery: Use local delivery by default, and enable global (cross-server) messaging through Redis when shared delivery is required.

Use case: You have a multi-server realtime app where user profile changes must notify all connected clients; post a UserUpdate event to a channel locally, or publish globally with Redis so every server instance can react.

Quick Start

Tell the AI to publish a UserUpdate to the user_updates channel using local delivery, then create a stream listener that prints each received message.

Frequently Asked Questions about serverpod-server-events

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

FAQPage Schema
How do I coordinate realtime events across multiple Serverpod server instances?

To coordinate realtime events across Serverpod clusters, publish typed, serializable event models to named channels. Enabling global delivery uses Redis to propagate messages and ensure state changes reach all connected servers.

How does pub/sub messaging work with typed Dart models in Serverpod?

Pub/sub messaging with typed Dart models works by posting serializable event types to named channels. Consumers then receive these structured realtime updates via reactive streams or callback listeners.

When do I need Redis for realtime Dart streams in a distributed deployment?

You need Redis for realtime Dart streams when requesting global delivery to share messages across distributed server instances. Local delivery works by default, but cross-server state propagation requires Redis-backed delivery.

What's the best way to broadcast state changes to connected clients in a Serverpod app?

The best way to broadcast state changes is publishing a typed event model to a named channel. Consumers can listen via streams or callbacks, receiving updates locally or globally across clusters using Redis.

Can I consume Serverpod events as a reactive stream instead of using callback listeners?

Yes, you can consume Serverpod events as a reactive stream. The system supports both stream-based consumption and callback listeners for receiving realtime updates from named channels.

Do I need to define serializable event types before using serverpod-server-events?

Yes, you must define serializable event types before using this Skill. Typed models are required to publish and consume realtime messages safely across named channels and distributed deployments.