litestar-realtime

Official

Build Litestar realtime apps with WebSockets and pub/sub.

Authorlitestar-org
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Building realtime features like WebSockets, Server-Sent Events, and cross-service event fan-out in Litestar requires handling authentication, backend selection, typed event contracts, and cross-process publishing logic from scratch, leading to inconsistent implementations and avoidable bugs. This Skill provides opinionated, production-ready patterns for every layer of the Litestar realtime stack, eliminating boilerplate and ensuring consistency with Litestar best practices.

Core Features & Use Cases

  • WebSocket & SSE Handler Patterns: Pre-built templates for connection lifecycle management, multi-tenant authentication guards, and request-scoped dependency injection for realtime endpoints.
  • Channels Plugin Configuration: Ready-to-use setup for all supported backends (in-memory, Redis, PostgreSQL LISTEN/NOTIFY, SQLSpec) selected based on your existing stack dependencies to avoid unnecessary infrastructure.
  • Typed Event Contracts: Canonical RealtimeEvent envelope, scope-based access control tables, and channel naming factories for consistent, type-safe pub/sub messaging across services.
  • Cross-Process Publishing: Patterns for broadcasting events from SAQ workers, CLI scripts, and database observers to connected realtime clients, with graceful handling of uninitialized channel backends.
  • Use Case Example: Build a workspace event stream that authenticates users via JWT query parameters, restricts access to workspace members, and broadcasts ETL job status updates from background workers to all connected clients in real time.

Quick Start

Use the litestar-realtime skill to implement an authenticated WebSocket endpoint that streams workspace-specific events to authorized users with typed payloads and proper disconnect handling.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: litestar-realtime
Download link: https://github.com/litestar-org/litestar-skills/archive/main.zip#litestar-realtime

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 536,000+ vetted skills library on demand.