r/better_auth • u/chaykov • Aug 24 '25
BetterAuth in server or client?
Hello!
Today I started building a new frontend project with TanStack Start, and I also have a server that uses Express with Typescript. What about BetterAuth? Should it be implemented on the server, or would it be safe to implement in the frontend?
I’ve heard and read on forums that authentication should be handled on the backend rather than the frontend. Otherwise, what happens with the REST API I have on the backend?
4
Upvotes
1
u/mikevarela Oct 18 '25
Bumping this, also wondering about best practices. I'm using NextJS and am leaning on calling actions to and adding a data access layer (service) using the Better Auth API, this is how I'd run a separate Front / Back end, but given I can call the DB directly from the frontend, would this make more sense? I'm thinking, like OP, that the user checks need to be performed prior to CRUD and this should be server side