Custom Express Endpoints with Better Auth: How to Handle Login and Authentication

I’m using Better Auth, which currently exposes its own API. I want to implement custom Express or Elysia endpoints instead. How does Better Auth determine if a user is authenticated, and how can I build an Express or Elysia endpoint that logs in a user using their email? What should the endpoint return to maintain proper authentication flow?
Was this page helpful?