Add-on for libSQL
Auth, built into your database
A libSQL database that ships pre-loaded with the Better Auth schema. Add email and password sign-in in a few lines, or bring Auth.js. No separate auth service, no extra bill.
Pre-loaded schema
Toggle "Set up as Auth Server" and the database comes with the Better Auth tables already created. Skip the migration step entirely.
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?
No. When you create the database with the Auth Server preset, the Better Auth schema (user, session, account, verification) is seeded for you. 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