[PR #2140] [CLOSED] docs(example): add example project for Hono and D1 integration #12420

Closed
opened 2026-04-13 08:22:19 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2140
Author: @ryutsuzu
Created: 4/5/2025
Status: Closed

Base: mainHead: docs/better-auth-hono-d1


📝 Commits (3)

  • 9da1fe1 docs: add example project for Hono and D1 integration
  • e07faf6 docs: add Hono + D1 example and update sidebar
  • dee76c1 refactor: remove Google social provider configuration and unused dependencies

📊 Changes

15 files changed (+2078 additions, -0 deletions)

View changed files

📝 docs/components/sidebar-content.tsx (+5 -0)
docs/content/docs/examples/hono-d1.mdx (+129 -0)
examples/hono-d1-example/.dev.vars.example (+5 -0)
examples/hono-d1-example/.gitignore (+33 -0)
examples/hono-d1-example/README.md (+105 -0)
examples/hono-d1-example/README_JP.md (+101 -0)
examples/hono-d1-example/better-auth/auth.ts (+8 -0)
examples/hono-d1-example/biome.json (+30 -0)
examples/hono-d1-example/migrations/0000_betterauth_migration.sql (+7 -0)
examples/hono-d1-example/package.json (+26 -0)
examples/hono-d1-example/pnpm-lock.yaml (+1523 -0)
examples/hono-d1-example/src/index.ts (+33 -0)
examples/hono-d1-example/src/lib/auth.ts (+39 -0)
examples/hono-d1-example/tsconfig.json (+17 -0)
examples/hono-d1-example/wrangler.jsonc (+17 -0)

📄 Description

I thought that the current documentation alone might not be sufficient for implementing an authentication API using Better Auth, Hono, and Cloudflare D1—especially since Cloudflare D1 has some unique aspects that could cause issues during setup or database migrations. So, I’ve added a sample project that demonstrates how to build an authentication API using Better Auth, Hono, and Cloudflare D1.

(I’ve previously implemented an authentication API using Hono and D1 without Better Auth, but using Better Auth made the development process significantly easier and more streamlined. I think it’s fantastic—thank you!)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/2140 **Author:** [@ryutsuzu](https://github.com/ryutsuzu) **Created:** 4/5/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `docs/better-auth-hono-d1` --- ### 📝 Commits (3) - [`9da1fe1`](https://github.com/better-auth/better-auth/commit/9da1fe1020ad61b029516831697a97223543fb61) docs: add example project for Hono and D1 integration - [`e07faf6`](https://github.com/better-auth/better-auth/commit/e07faf6cac75d981c7628b141dda8bf034e9ff5a) docs: add Hono + D1 example and update sidebar - [`dee76c1`](https://github.com/better-auth/better-auth/commit/dee76c1474e794ed5e70abc4e223d1e1ce75c954) refactor: remove Google social provider configuration and unused dependencies ### 📊 Changes **15 files changed** (+2078 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/sidebar-content.tsx` (+5 -0) ➕ `docs/content/docs/examples/hono-d1.mdx` (+129 -0) ➕ `examples/hono-d1-example/.dev.vars.example` (+5 -0) ➕ `examples/hono-d1-example/.gitignore` (+33 -0) ➕ `examples/hono-d1-example/README.md` (+105 -0) ➕ `examples/hono-d1-example/README_JP.md` (+101 -0) ➕ `examples/hono-d1-example/better-auth/auth.ts` (+8 -0) ➕ `examples/hono-d1-example/biome.json` (+30 -0) ➕ `examples/hono-d1-example/migrations/0000_betterauth_migration.sql` (+7 -0) ➕ `examples/hono-d1-example/package.json` (+26 -0) ➕ `examples/hono-d1-example/pnpm-lock.yaml` (+1523 -0) ➕ `examples/hono-d1-example/src/index.ts` (+33 -0) ➕ `examples/hono-d1-example/src/lib/auth.ts` (+39 -0) ➕ `examples/hono-d1-example/tsconfig.json` (+17 -0) ➕ `examples/hono-d1-example/wrangler.jsonc` (+17 -0) </details> ### 📄 Description I thought that the current documentation alone might not be sufficient for implementing an authentication API using Better Auth, Hono, and Cloudflare D1—especially since Cloudflare D1 has some unique aspects that could cause issues during setup or database migrations. So, I’ve added a sample project that demonstrates how to build an authentication API using Better Auth, Hono, and Cloudflare D1. (I’ve previously implemented an authentication API using Hono and D1 without Better Auth, but using Better Auth made the development process significantly easier and more streamlined. I think it’s fantastic—thank you!) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 08:22:19 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#12420