Back to feed
Dev.to
Dev.to
6/17/2026
Real-time chat with Fitz: typed WebSockets and AsyncAPI auto-generated

Real-time chat with Fitz: typed WebSockets and AsyncAPI auto-generated

Short summary

Add real-time WebSocket dashboards with Fitz's @ws decorator for type-safe connections and automatic AsyncAPI schema generation. Auth, validation, and type-checking apply to WebSockets just like HTTP endpoints—no manual serialization needed. Broadcast messages to multiple connections and configure keepalive heartbeats in ~40 lines.

  • @ws decorator provides type-safe WebSocket endpoints with automatic serialization and AsyncAPI schema generation
  • Same auth, validation, and error handling from HTTP apply seamlessly to WebSocket frames
  • Broadcast to multiple connections and built-in heartbeat keepalive prevent connection timeouts in production

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more