---
title: "Discussion on \"How the userId is added to the tRPC ctx in LobeChat source code?\" | Hashnode"
description: "Discussion on \"How the userId is added to the tRPC ctx in LobeChat source code?\". In this article, we analyse how the currently logged-in userId is added to the tRPC ctx by reviewing LobeChat source code. I recommend reading this tRPC setup to relate to the concepts explained in this article.\nBut before that, I want to explain how..."
url: "https://hashnode.com/posts/how-the-userid-is-added-to-the-trpc-ctx-in-lobechat-source-code/6757f6ff69e082d946d1366b"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How the userId is added to the tRPC ctx in LobeChat source code?](https://thinkthroo.com/blog/how-the-userid-is-added-to-the-trpc-ctx-in-lobechat-source-code?utm_source=hashnode&utm_medium=feed)

In this article, we analyse how the currently logged-in userId is added to the tRPC ctx by reviewing LobeChat source code. I recommend reading this tRPC setup to relate to the concepts explained in this article. But before that, I want to explain how...

Dec 10, 2024 · 3 min read · thinkthroo.com  
Updated Apr 3, 2025  
Read the article

-   [#clerk-auth](https://hashnode.com/tag/clerk-auth)
-   [#ctx](https://hashnode.com/tag/ctx)
-   [#trpc](https://hashnode.com/tag/trpc)
-   [#lobechat](https://hashnode.com/tag/lobechat)
-   [#auth](https://hashnode.com/tag/auth)

## Written by

[Ramu Narasinga](https://hashnode.com/@ramunarasinga)

@ramunarasinga · India

  
[View profile](https://hashnode.com/@ramunarasinga)

I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
