vpjm
vpjm3w ago

Private chat with TRPC

Hi I'm relatively new to tRPC and I'm currently trying to implement private chat rooms (1:1 conversations or small groups). I’ve checked out the tRPC SSE chat example https://github.com/trpc/examples-next-sse-chat, but it seems to be designed more for public chat rooms. Could someone please point me in the right direction or share some tips on how to structure private conversations using tRPC ? ( atm, I manually check for each operation whether the user is part of the room, but I don't find this approach very intuitive. ) Thanks a lot in advance! Maybe it's related to this https://github.com/trpc/trpc/issues/3955, but I'm not sure. version : v11
1 Reply
Nick
Nick2w ago
That’s generally what you have to do, and would be the same anywhere. There may be some clever patterns using middlewares but they’d just tidy up your code and if your knowledge isn’t there I wouldn’t worry

Did you find this page helpful?