inferring types on the client, based on plugins added on the server
I have a monorepo, with the
admin
plugin added to the server initialization of betterAuth
. I was expecting the additional user properties, like role
would be accessible from session.user
.
Here's my server code:
And this is the auth client on the frontend:
Then, when trying to access the role
property from the session.user
object, I get:
FWIW, I can do the following on the client, and I get the actual shape of User:
What's the right approach to get the User shape in the client side in the session
object?0 Replies