This monorepo provides the code and demonstrates how a website can use Google Apps Script without any of the existing limitations of an Apps Script webapp. The website deployment script is made for Firebase hosting, but you can modify package.json use any hosting. The integration patterns are documented in readme.md, and both the standalone bridge and iframe modes live side-by-side here.
website/– Vite-based front end that hosts the GAS plus helpers. Seewebsite/AGENTS.mdfor authoring conventions.website/functions(optional) – Firebase Cloud Functions that proxy frontend logging to GCP logging.google-apps-script/– Source, build scripts, and deployment helpers for the Apps Script project. Seegoogle-apps-script/AGENTS.md.util-org-sig/(optional) – Helper scripts described inutil-org-sig/readme.mdfor creating ECDSA keys used by both projects.
For a conceptual overview of both methods and the shared messaging contract, start with readme.md. Update that document, plus the relevant AGENTS.md, whenever you change integration behavior so the docs stay consistent.
Two flows are maintained in parallel:
- Bridge (parent-hosted) – The website proxies
google.script.runcalls viawebsite/src/components/js/gscriptrun.js, talking to Apps Script HTML served fromgoogle-apps-script/src/html/bridge.html. - Iframe HTMLService – GAS pages render inside an iframe and exchange events with
website/src/js/common.jsthrough the handlers ingoogle-apps-script/src/js/util.js.
When you add new bridge or iframe messages, update both projects and keep the contract table in readme.md current.
- Install dependencies for each project you touch (
npm installinwebsite/,website/functions/, orgoogle-apps-script/). - The Firebase Cloud Functions expect Node.js 22. Vite builds the front end with your local Node version (>=18 is recommended).
- The
.envfiles are configured once and generally not modified..env.localis used to overwrite values in.env, only for development builds. - Keep matching variables (for example
URL_WEBSITE, Firebase project identifiers, and shared public keys) aligned between the website and Apps Script directories.
- Website static build:
npm run buildinsidewebsite/. - Firebase functions deployment:
npm run deployfromwebsite/functions/. For local emulation, usenpm run serve. - Apps Script bundle & push:
npm run buildinsidegoogle-apps-script/(runs the HTML/JS inliner andclasp push). Usenpm run deployto build and deploy. - No automated tests are defined; please run the relevant build steps above before submitting changes.
- JavaScript (both front end and Apps Script) uses 2 spaces for indentation, ES modules, and double quotes. Match the surrounding style when editing files.
- Prefer descriptive comments for exported/public functions so that the integration points stay discoverable.
- Use
console.warnandconsole.errorto alert the developers of unusual situations, failed assertions and errors. Those alerts are logged and sent to the development team automatically.
- Coordinate changes across
website/andgoogle-apps-script/so the bridge and iframe integrations stay compatible. util-org-sig/scripts are optional, but when you rotate keys, also update the public key constants referenced in both codebases.
Refer to the AGENTS.md file in the subdirectory you are modifying for more specific conventions.