This service provides Google sign-in and private user profiles on Cloudflare Workers. Users can edit their names, sign out, and delete their accounts.
The API uses TypeScript and OpenAuth. D1 stores users and sessions. KV stores temporary OAuth records. The browser uses HttpOnly session cookies and keeps tokens out of localStorage.
Use Node 24.19.0 and npm 11.17.0. You do not need cloud credentials.
Install the dependencies:
npm ci --ignore-scripts-
Compile the Worker and browser code.
npm run build
-
Run the backend tests.
npm test -
Install Chromium.
node node_modules/playwright/cli.js install chromium
On Linux, use Playwright's setup instructions to install the required system libraries.
-
Run the browser tests.
npm run test:browser
npm run check builds the Worker bundle without deployment.
npm audit --ignore-scripts checks dependencies for known vulnerabilities.
The tests use local workerd, D1, KV, and Chromium. They simulate Google's responses. GitHub CI passed 206 backend tests and 26 browser tests. CI does not deploy the service.
Complete Set up before these steps. Keep the client secret out of Git, issues, screenshots, and the browser console.
-
Create a Google OAuth Web application client with Google's setup guide. If the client uses testing mode, add your Google account to its test users.
-
Register
http://localhost:8787/google/callbackas the authorized redirect URI. Do not use the service's internal/callbackroute for Google. -
Copy
.dev.vars.exampleto.dev.vars. Enter the client's ID and secret in.dev.vars. Git ignores this file. -
Apply the local migrations. Start the Worker:
npm run migrate:local npm run dev
-
Open
http://localhost:8787/. Select Continue with Google.
Use localhost, not 127.0.0.1, to match ISSUER_ORIGIN in wrangler.json.
Wrangler reads the credentials from the local secret file.
Do not use wrangler secret put for local setup.
Real Google login and HTTPS sessions still need live verification.
Do not deploy with the resource IDs in wrangler.json. They belong to the original setup.
The remote npm scripts require a separate wrangler.deploy.json with dedicated Worker, D1, and KV resources.
That file does not exist yet.
Before deployment, complete the deployment checklist. It includes authentication rate limits, Google configuration, and live account-isolation tests. The database retention and restore requirements are in the API contract.
Based on Cloudflare's OpenAuth template. This project is not an official Cloudflare service.