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?
No description
No description
No description
No description
Solution:
At auth-client.ts: Change the "better-auth/client" to "better-auth/react"...
Jump to solution
2 Replies
Solution
Maqed
Maqed•6d ago
At auth-client.ts: Change the "better-auth/client" to "better-auth/react"
Dennski
DennskiOP•6d ago
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!
No description
No description

Did you find this page helpful?