Skip to main content

In-app SSE stream & notification center

Generated from pattern-library/registry.json — do not edit by hand; change the registry and run bun run patterns:build.

Index card — the docs below are the canonical explanation; deep-tier pattern pages additionally carry invariants and emulation notes.

Category: Notifications · Tier: light · Maturity: proven (verified 2026-08-20 @ 1a130d67) · Risk: low — same-origin authenticated stream, connection-limited

One SSE route serves notifications in real time over two transports: an in-memory connection map on a persistent host, Redis pub/sub on Vercel serverless; the account pages re-run their load via invalidate() instead of holding a stream open.

When to use: Use when the UI needs near-real-time in-app notification delivery without standing up a third-party pub/sub service.

Docs

Code

  • src/lib/server/notifications/stream.ts (GitHub · GitLab)
  • src/routes/api/notifications/stream/+server.ts (GitHub · GitLab)

Proof


Machine-readable record: notifications-sse-stream in pattern-library/registry.json.

← Back to Pattern Library

Think this pattern could be better? Tell us how.

Leave feedback