TanStackT
TanStackโ€ข7mo agoโ€ข
2 replies
inadequate-blush

Tanstack Router and Clerk

I have a React SPA web application with Tanstack Router (file-based routing) and I want to protect the whole app - except the login route I guess - using Clerk (I will later also protect my Hono backend's endpoints but that's for later). Considering Clerk is a partner of Tanstack, I was hoping I could find some "official" examples on how to do this properly, but unfortunately the only resources I could find were for Tanstack Start, and a few old repos with completely different approaches.

I would really appreciate if anyone could explain or show me how to do it properly once and for all, so I can use it in all my apps, knowing it most likely follows best practices, is secure, doesn't slow down my app unnecessarily (big concern), etc.

Thank you ๐Ÿ™‚
Was this page helpful?