useSession is not is not callable ?
need help with the clients hooks every client hook gives me a typescript error like this
This expression is not callable.
No constituent of type 'Atom<{ data: { session: { userAgent: string | null | undefined; id: string; createdAt: Date; updatedAt: Date; userId: string; expiresAt: Date; token: string; ipAddress?: string | null | undefined; }; user: { ...; }; } | null; error: BetterFetchError | null; isPending: boolean; }>' is callable.ts(2349)
Solution:Jump to solution
My guess is your auth client is importing
createAuthClient
from better-auth/client
rather than better-auth/react
6 Replies
Please provide your setup. I.e: auth.ts and auth-client.ts
probably hook is an issue , you should be using a the hook with in react component if you dont want to use it there , make sure to call it on server with auth.api.getSession() as well
Solution
My guess is your auth client is importing
createAuthClient
from better-auth/client
rather than better-auth/react
@Ashraf Elshaer
That was the problem thanks A lot for your help
🫡