Elysia Integration
This integration guide is assuming you are using Elysia with bun server.
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 Elysia endpoint.
Middleware
You can use derive to provide session and user information before pass to view.
This will allow you to access the user
and session
object in all of your routes.