TanStackT
TanStack6mo ago
8 replies
brilliant-orange

Server-side vs client-side validation

Which approach is better when working with Tanstack Start and Tanstack Form, is it server-side validation like the link bellow or client-side validation for authentication using Better Auth?
https://tanstack.com/form/latest/docs/framework/react/guides/ssr
In better auth docs, they recommend using auth client with Tanstack Start:

We recommend using the client SDK or authClient to handle authentication, rather than server actions with auth.api

while with Next.js, they recommend using server actions and RSC:

The api object exported from the auth instance contains all the actions that you can perform on the server. Every endpoint made inside Better Auth is a invocable as a function. Including plugins endpoints.

How should I go with it?
TanStack Form is compatible with React out of the box, supporting SSR and being framework-agnostic. However, specific configurations are necessary, according to your chosen framework. Today we support...
React Meta-Framework Usage | TanStack Form React Docs
Was this page helpful?