sailfork / t3code-github / .repos/ alchemy-effect/ examples/ cloudflare-domain-better-auth/ README.md

Domain + better-auth on Cloudflare

Signs users in to a Domain Api with GitHub or Google through better-auth, with a foldkit UI. Companion to the Sign in with better-auth page.

Run locally

pnpm install
cd examples/cloudflare-domain-better-auth
cp .env.example .env   # add your GitHub and Google OAuth credentials
bun alchemy dev

alchemy dev prints the app's URL (http://localhost:1338). Register <app url>/api/auth/callback/github and <app url>/api/auth/callback/google as the callback URLs of your OAuth apps.

Test

pnpm test

The tests sign users in through a local OpenID Connect provider, then call the Api over HTTP with the session cookie. foldkit stories test the app's update.