Docs

Solid Start Integration

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 Solid Start server. Put the following code in your *auth.ts file inside /routes/api/auth folder.

*auth.ts
import { auth } from "~/lib/auth";
import { toSolidStartHandler } from "better-auth/solid-start";
 
export const { GET, POST } = toSolidStartHandler(auth);

On this page

Edit on GitHub