Research Hub

Provisions and collects data via Google Sheets. This runs as a separate deployment on Google's infrastructure (Apps Script), not on Vercel — it can never appear "inside" this site's domain, it's a different platform by design. This page is a thin client that talks to it through a server-side proxy.

Step 1 — one-time setup

Deploy the Apps Script Web App

  1. Open script.google.com, create a new project
  2. Paste in the contents of google-apps-script/sheet-provisioner.gs from this repo
  3. Deploy → New deployment → type "Web app" → Execute as "Me" → Access "Anyone"
  4. Copy the deployment URL (ends in /exec)
  5. In Vercel: Project Settings → Environment Variables → add APPS_SCRIPT_URL = that URL, then redeploy
Why a server-side proxy instead of calling the Apps Script URL directly from this page's JS: Google's Web App responds via a redirect to script.googleusercontent.com that doesn't carry CORS headers, so a direct browser fetch() fails with an opaque CORS error. The /api/research/submit route on this server forwards the request instead, which sidesteps the browser entirely.
Step 2 — provision a study (run once per study)

Create a study sheet

Run createStudySheet(schema) directly from the Apps Script editor (Step 1) with your schema — see the JSDoc at the top of sheet-provisioner.gs for the exact shape. This isn't wired into this page yet since it's a one-off action per study, not a repeated one.

Step 3 — collect data

Submit a row