mirror of
https://github.com/better-auth/better-auth.git
synced 2026-10-18 11:32:15 -05:00
1.7.0 made both methods required on CustomAdapter and removed the factory fallback, so a custom adapter written for 1.6 type-checks against nothing and throws at request time on the first OTP, magic link, password reset, or two-factor attempt. Restore the fallbacks. consumeOne without a native implementation runs findOne then an id-guarded deleteMany and wins only when exactly one row was deleted. incrementOne runs a bounded compare-and-swap loop: findOne, then updateMany guarded on the id and the counter values just read, retried when a concurrent writer changed the row first. Both are single guarded statements per attempt, so they stay atomic across processes without transactions.
Website & Docs
The main website and documentation for better-auth.com
Quick Start
# install
pnpm install
# develop
pnpm dev
Open localhost:3000 to preview.
Stack
- Framework: Next.js 16 (App Router, Turbopack)
- Styling: Tailwind CSS 4
- Animation: Framer Motion
- Docs: Fumadocs
- Icons: Lucide React
- Fonts: Geist Sans & Geist Mono
Structure
├─ app/
│ ├─ page.tsx # Home — hero + sign-in demo
│ ├─ products/ # Products page
│ ├─ blog/ # Blog posts
│ └─ docs/[[...slug]]/ # Documentation (MDX)
│
├─ components/
│ ├─ landing/ # Marketing components
│ ├─ docs/ # Documentation components
│ ├─ ui/ # Shared primitives
│ └─ icons/ # Brand icons & logo
│
├─ content/ # MDX documentation files
│
├─ lib/
│ ├─ source.ts # Fumadocs content source
│ └─ utils.ts # Utilities
│
└─ public/
└─ branding/ # Logo assets (SVG + PNG)
Scripts
pnpm dev # Start dev server (Turbopack)
pnpm build # Production build
pnpm start # Serve production build
pnpm lint:fix # Lint & auto-fix with Biome