]> git.ardis.lu - google-forms-comments/summary
 
descriptionA simple comment system that uses Google Forms and Google Sheets as its backend.
last changeWed, 22 Apr 2026 06:42:39 +0000 (23:42 -0700)
readme

google-forms-comments

A simple comment system that uses Google Forms and Google Sheets as its backend.

Code repository mirrors: GitHub, Codeberg, git.ardis.lu

Creating comments

To create new comments, the frontend directly POSTs to the Google Form. Since the POST is cross-origin, it is sent in no-cors mode and the response is opaque. The frontend assumes all POSTs are successful. If the POST is blocked by Google Forms for any reason (e.g. if Google suspects the end-user is a bot and does a CAPTCHA challenge), then the comment will be silently dropped.

Reading comments

The /functions/comments.js file is a Cloudflare Worker that acts as a proxy to access the Google Sheets API. The Cloudflare Worker injects a service account's credentials to the API request because the Google Sheets API requires authorization for all requests, even requests to public spreadsheets.

Local development

Use the wrangler CLI to serve the static frontend and the Cloudflare Worker proxy at the same time.

  1. Copy .dev.vars.example and rename the copy to .dev.vars. Provide an email and private key for a service account with access to the Google Sheet that has the form responses.

  2. npx wrangler pages dev .

shortlog
2026-04-22 Ardis LuAdd code repository mirrors main
2026-04-21 Ardis LuAdd MIT license
2025-01-26 Ardis LuIgnore temporarily generated files by wrangler
2025-01-26 Ardis LuSimplify font stack
2025-01-05 Ardis LuFix preload
2024-07-02 Ardis LuRemove integrity on self-hosted script
2024-06-27 Ardis LuFix preloads
2024-06-23 Ardis LuPreload script
2023-04-04 Ardis LuUse Inter CDN instead of bundling
2023-01-28 Ardis LuAdd OpenGraph tags
2023-01-24 Ardis LuAdd temporary error logging
2023-01-24 Ardis LuUse transparent characters for spacing
2023-01-24 Ardis LuSet width to fit-content for shorter names
2023-01-23 Ardis LuInitial commit
heads
5 months ago main
This page took 0.05982 seconds and 7 git commands to generate.