Add-on for libSQL
Auth, built into your database
A libSQL database set up for the Better Auth schema, applied in one click or with your own migration. Add email and password sign-in in a few lines, or bring Auth.js. No separate auth service, no extra bill.
One-click schema
Toggle "Set up as Auth Server", then apply the Better Auth tables in one click from the dashboard, or run your own migration. Your call, no black box.
Email and password, day one
Better Auth handles password hashing (scrypt), sessions, and verification. Optionally seed an admin user at create time and sign in immediately.
Familiar if you know Supabase
The client SDK reads like Supabase auth: signUp.email() and signIn.email(). The same mental model, on a database you own.
Bring your own library
Prefer Auth.js? Copy-paste recipes for Drizzle, Kysely, and Prisma ship in the dashboard, plus raw libSQL and Python options.
Quickstart
import { betterAuth } from 'better-auth'
import { createClient } from '@libsql/client'
import { LibsqlDialect } from '@libsql/kysely-libsql'
export const auth = betterAuth({
database: {
dialect: new LibsqlDialect({
client: createClient({
url: process.env.LIBSQL_URL!,
authToken: process.env.LIBSQL_AUTH_TOKEN,
}),
}),
type: 'sqlite',
},
emailAndPassword: { enabled: true },
})Common questions
Do I have to run migrations?
Only if you want to. Creating the database with the Auth Server preset sets it up for the Better Auth schema (user, session, account, verification); apply it in one click from the Setup panel, or run your own migration (the better-auth CLI, or your ORM). Other libraries (Auth.js, raw) manage their own schema and are best on a fresh database.
Which auth libraries are supported?
Better Auth is the default (email and password out of the box). The dashboard also ships verified recipes for Auth.js via Drizzle, Kysely, or Prisma, a raw @libsql/client recipe, and a Python (FastAPI) recipe.
Is it really free?
Yes. libSQL is on the Layerbase free tier, including TLS, generated credentials, and IP allowlists. There is no separate charge for auth.
Can I use it outside Next.js?
Yes. Better Auth is framework agnostic, so the same setup works behind Express, Hono, SvelteKit, or plain Node. libSQL also has Python and raw clients.
Further reading:Setup guideBetter Auth: email and password