Back to articles
Better Auth Has a Free API — TypeScript Authentication That Just Works

Better Auth Has a Free API — TypeScript Authentication That Just Works

via Dev.to WebdevAlex Spinov

Better Auth is a TypeScript-first authentication framework. Session-based auth, OAuth, 2FA, organizations — with a plugin system and auto-generated client. Why Better Auth? TypeScript-first — auto-generated typed client from server config Framework agnostic — Next.js, Nuxt, SvelteKit, Hono, Express Plugins — 2FA, organizations, magic link, passkey — add with one line Self-hosted — runs on YOUR server with YOUR database Quick Start npm install better-auth // auth.ts import { betterAuth } from ' better-auth ' ; import { drizzleAdapter } from ' better-auth/adapters/drizzle ' ; export const auth = betterAuth ({ database : drizzleAdapter ( db , { provider : ' pg ' }), emailAndPassword : { enabled : true }, socialProviders : { github : { clientId : process . env . GITHUB_CLIENT_ID ! , clientSecret : process . env . GITHUB_CLIENT_SECRET ! , }, google : { clientId : process . env . GOOGLE_CLIENT_ID ! , clientSecret : process . env . GOOGLE_CLIENT_SECRET ! , }, }, }); Client (Auto-Generated Typ

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
2 views

Related Articles