Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.22 KB

README.md

File metadata and controls

33 lines (23 loc) · 1.22 KB

tRPC + Server-sent Events (SSE)

This example showcases the use of httpSubscriptionLink to facilitate .useSubscription via Server-sent Events.

Try demo http://sse.trpc.io/

Features

  • 🧙‍♂️ E2E type safety with tRPC
  • ⚡ Full-stack React with Next.js
  • ⚡ Server-Sent-Events / Subscription support
  • ⚡ Database with Drizzle
  • 🔐 Authorization using next-auth

Code

This project includes 2 examples of the subscription pattern:

  1. Simple example of whoIsTyping
  2. A slightly more involved example of livePosts

Setup

git clone [email protected]:trpc/examples-next-sse-chat.git
pnpm i
cp .env.example .env
pnpm dev