Help with Better-Auth in Next.js – useSession Causing 404 Error
Hey everyone! 👋
I’m trying out Better-Auth (v1.1.21) for the first time with Next.js and Postgres. My sign-in and sign-up are working fine, but when I try using useSession inside a client component, I get a 404 error.
I'll share some screenshots for reference. Could this be a session issue or a misconfiguration?




Solution:Jump to solution
At auth-client.ts:
Change the "better-auth/client" to "better-auth/react"...
2 Replies
Solution
At auth-client.ts:
Change the "better-auth/client" to "better-auth/react"
Thank you so much @Maqed, This solved the issue I encountered.
I didn't notice that the imports were different. I checked the basic usage guide before the installation guide, so I missed it. Thanks again!

