TanStack Start Integration
This integration guide is assuming you are using TanStack Start.
Before you start, make sure you have a Better Auth instance configured. If you haven't done that yet, check out the installation.
Mount the handler
We need to mount the handler to a TanStack API endpoint.
Create a new file: /app/routes/api/auth/$.ts
This will allow you to access use the getSession
method in all of your routes.