Portfolio

Better Auth

A simple authentication setup for Next.js applications using SQLite database.

Installation

pnpm dlx shadcn@latest add https://ui.ahmet.studio/r/better-auth-next

Features

  • SQLite Database - Uses SQLite for simple, file-based data storage
  • TypeScript Support - Full TypeScript support out of the box
  • Next.js Integration - Seamlessly integrates with Next.js App Router
  • Zero Configuration - Works with minimal setup required

Basic Example

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>; }

Next Steps

After installation, you can:

  • Add authentication providers (Google, GitHub, etc.)
  • Customize the authentication flow
  • Add user sessions and protected routes
  • Implement user registration and profile management

For more advanced configurations, refer to the Better Auth documentation.