Better AuthBA
Better Auth•10mo ago
Dennski

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?
Cookie.png
authClient.png
Page.tsx.png
404_error.png
Solution
At auth-client.ts:
Change the "better-auth/client" to "better-auth/react"
Was this page helpful?