Hono Integration
This integration guide is assuming you are using Hono with node 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 hono endpoint.
Cors
To configure cors, you need to use the cors
plugin from hono/cors
.
Middleware
You can add a middleware to save the session
and user
in a context
and also add validations for every route.
This will allow you to access the user
and session
object in all of your routes.