This repo is a focused, technical demo of integrating Better Auth with SvelteKit. The UI is a simple travel journal, but the real goal is showcasing auth flows, email delivery, and database wiring end-to-end.
pnpm install
cp .env.example .env
Update .env with the required values:
DATABASE_URL=local.db
BETTER_AUTH_SECRET=your-random-secret
BETTER_AUTH_URL=http://localhost:5173
MAILER_HOST=127.0.0.1
MAILER_PORT=1036
MAILER_FROM="Travel Journal <[email protected]>"
GOOGLE_CLIENT_ID=your-google-client-id # optional
GOOGLE_AUTH_SECRET=your-google-client-secret # optional
pnpm dev:services
Mailpit runs at http://localhost:8036 and listens for SMTP on port 1036.
pnpm db:push
pnpm dev
Open http://localhost:5173 in your browser.