Facing difficulties with NextJS + Hono + D1 (Cloudflare stack)
Hi I am trying to make better-auth work with nextjs + hono in the cloudflare stack. But I'm having some difficulties doing so!
Main goal is:
Repo: https://github.com/raikusy/nextjs-hono-better-auth-d1
Main goal is:
- Nextjs should be deployed to Cloudflare pages.
- Hono should be deployed to Cloudflare workers.
- Will be using Cloudflare D1 as database.
- When I hit
/auth/sessionIt doesn't return the session. Actually when I passc.req.raw.headersin the getSession method, the header doesn't contain thebetter_session_tokencookie. Although I can see the cookie is there in my browser. Idk! Maybe I'm doing something wrong. - Am I doing things the right way?
- I had to manually define
/login/registeretc auth routes to get typesafety in hono client RPC.
Repo: https://github.com/raikusy/nextjs-hono-better-auth-d1
GitHub
Contribute to raikusy/nextjs-hono-better-auth-d1 development by creating an account on GitHub.


