A database is required for storing your users and sessions. Lucia connects to your database via an adapter, which provides a set of basic, standardized querying methods that Lucia can use.

import { Lucia } from "lucia";
import { BetterSqlite3Adapter } from "@lucia-auth/adapter-sqlite";

const lucia = new Lucia(new BetterSqlite3Adapter(db));

See Adapter for building your own adapters.

Database setup

Refer to these guides on setting up your database, ORMs, and query builders: