0

My idea is to have a root procedure that only can be called from the server itself (i.e: during calls from getStaticProps or getStaticPaths at build time). I want to set a magic token via env and protect a trpc procedure against this random token.

I'm struggling on find the division of backend and client usage on trpc.

Any help would be appriciated.

I tried using the typeof window === "undefined" and attaching a magic token to the session but it doesn't seem to be a good solution, the token on session gets overridden for some reason and the typeofwindow simply doesn't make sense as the server code will always be executed on the server.

0 Answers0