Overview
better-auth-cloudflare integrates the Better Auth authentication library with Cloudflare Workers, D1, Hyperdrive, KV, R2 and Cloudflare’s geolocation data. It works with any framework that runs on Workers; the examples/ folder has OpenNext (Next.js) and Hono demos, both live on workers.dev.
Features
- Databases — D1 (SQLite), Postgres and MySQL through Drizzle ORM, or native D1 without Drizzle
- Hyperdrive for connecting to Postgres and MySQL
- KV as optional secondary storage, for example session caching
- R2 for file uploads tied to users
- Geolocation from Cloudflare request data
- Scripts for generating the auth schema and running migrations