Skip to content

feat: support Better Auth 1.7 with atomic storage - #64

Open
zpg6 wants to merge 1 commit into
mainfrom
feat/better-auth-1-7-atomic-storage
Open

feat: support Better Auth 1.7 with atomic storage#64
zpg6 wants to merge 1 commit into
mainfrom
feat/better-auth-1-7-atomic-storage

Conversation

@zpg6

@zpg6 zpg6 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Follow-up to #62.

Better Auth 1.7 requires atomic increment and getAndDelete, which KV cannot provide. This adds an optional Durable Object adapter without silently moving existing KV users onto a paid backend.

The Hono example uses Durable Objects for secondary storage. OpenNext keeps KV for session caching, stores verification data in D1, and uses a Durable Object only for rate limiting. That split is intentional: each atomic operation routed through a Durable Object adds a request.

This also tightens the upgrade path. The CLI creates a fresh lockfile with the selected package manager, remote migrations require a separate reviewed command, and CI regenerates the Drizzle SQL, snapshot, and journal instead of trusting hand-edited migration files.

One sharp edge remains upstream: the generated 1.7 migration adds accounts.issuer as NOT NULL. Anyone upgrading a populated 1.6 database still needs to back it up and rehearse that migration first.

@pkg-pr-new

pkg-pr-new Bot commented Aug 31, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/better-auth-cloudflare@64

commit: 767f09a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant