how to correctly type useSession on the client side
I'm using React and using the useSession hook that comes from authClient, the data type comes as const data: {
user: any;
session: any;
} | null. I saw the correct values in the console. How can I correctly type the user and session? This is my first time doing this setup


8 Replies
That's certainly unusual. Just a few questions:
Are you in a monorepo setup?
What's the import path for
createAuthClient in your case in your auth config?
Can I see your tsconfig?Mono repo with multiple clients, without api but we intend to move the api to mono repo as well. At the moment only in the clintes



In the same file which you defined the
authClient, can you see if the types are correct for authClient.useSession?
It could be related to the tsconfig but I'm not too sure, I can't spot anything that I know would cause common BetterAuth related issues. Using the most basic form of setup like you have should work, I think the issue stems somewhere between the monorepo and tsconfig 🤔