How to use const session = c.get("session") and const user = c.get("user") in Hono when routes?
Hi everyone, I'm using Hono but the only way I can retrieve c.get("user") is if I export my app variables type?
Is there a more elegant way to do this? Maybe export the "whole app" in each route instead of just variables?
index.ts:
example of a route (thread.ts):
9 Replies
you can try
c.var.user
or are you asking about something different?I’m wondering if there is a better way than having to import variables in each individual route?
create a utility function
and call this
Yeah that’s what I thought, thx!
its more of to do with how hono works than better-auth
True sorry wrong discord I guess haha
doing this actually breaks my Hono RPC setup?

Think i'll stick to variables for the moment, thx
oh that might happen yeah, i havent used hono rpc much