A simple authentication setup for Next.js applications using SQLite database.
This setup uses Better Auth, a modern authentication library for TypeScript applications. This implementation is configured with SQLite as the database and Next.js for simplicity.
pnpm dlx shadcn@latest add https://ui.ahmet.studio/r/better-auth-next
import { authClient } from "@/lib/auth-client"; export function LoginButton() { const handleLogin = async () => { await authClient.signIn.email({ email: "user@example.com", password: "password", }); }; return <button onClick={handleLogin}>Sign In</button>; }
After installation, you can:
For more advanced configurations, refer to the Better Auth documentation.