subscriptions

Enable real-time tRPC event streams via SSE or WebSocket subscriptions.

2|Updated Apr 11, 2026
One-click install
npx skills add https://github.com/PlazaCC/antes-da-tela --skill subscriptions-plazacc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: subscriptions
Source: https://github.com/PlazaCC/antes-da-tela/tree/main/.agents/skills/subscriptions
Command: npx skills add https://github.com/PlazaCC/antes-da-tela --skill subscriptions-plazacc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Applications often need live updates from the server, but setting up reliable real‑time streams with reconnection handling can be complex.

Core Features & Use Cases

  • SSE subscriptions: Simple Server‑Sent Events setup with automatic ping and client reconnection.
  • WebSocket support: Bidirectional communication when needed via wsLink and a WebSocket server.
  • Reconnection recovery: Use tracked() to resume streams after disconnects.
  • Polling loop subscriptions: Generate events from database polls as async generators.
  • Cleanup handling: Ensure resources are released when a subscription ends.

Quick Start

Use the tRPC client with splitLink so that subscription operations automatically use httpSubscriptionLink while other calls use httpBatchLink.

Frequently Asked Questions about subscriptions

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

FAQPage Schema
How do I set up real-time subscriptions in tRPC using Server-Sent Events?

To configure real-time subscriptions, use a tRPC splitLink to route subscription operations to httpSubscriptionLink while other calls use httpBatchLink, enabling SSE push updates.

What is the best way to handle reconnection recovery for tRPC WebSocket streams?

Reconnection recovery for tRPC streams is handled using the tracked() function, which assigns tracked event IDs to resume async generator streams after unexpected disconnects.

How do I create a polling loop subscription that generates events from database changes?

Polling loop subscriptions are created by writing an async generator that polls your database and yields new events, integrated directly into your tRPC subscription procedure.

When should I use WebSocket support instead of Server-Sent Events for live updates?

WebSocket support via wsLink is needed for bidirectional communication, while Server-Sent Events are simpler for unidirectional push updates like new posts or collaborative data.

How does cleanup handling work for tRPC async generator subscriptions?

Cleanup handling in tRPC async generator subscriptions ensures resources are properly released when a subscription ends, preventing memory leaks in your real-time event streams.