Skip to main content

Google Drive Integration

Files upload to Google Drive instead of Supabase Storage for permanent, shareable URLs.

Why Drive?

  • Permanent URLs — Never expire (unlike signed URLs)
  • Airtable compatible — Attachments sync directly
  • Organized — Folders per form and submission

Architecture

Setup

1. Create Service Account

In Google Cloud Console:
  1. Create a new project
  2. Enable Google Drive API
  3. Create a service account
  4. Download JSON credentials

2. Configure Environment

GOOGLE_SERVICE_ACCOUNT_JSON='{"type":"service_account",...}'

3. Share Folder

Share your Drive folder with the service account email.

4. Configure Form

In Form SettingsIntegrations:
  • Enter the Google Drive folder ID
  • (Optional) Set per-field folder IDs

File Structure

Drive Folder/
├── RENT-2024-001/
│   ├── id-front.jpg
│   └── tax-return.pdf
├── RENT-2024-002/
│   └── proof-of-income.pdf

Upload Flow

Uploads are streamed directly to Google Drive via a resumable session. The API validates the form, the file field, and (if provided) the per-field folder ID. Required query params:
  • formId
  • submissionId (pending session ID)
  • filename
  • questionId (the files field ID)
Optional query params:
  • folderId (per-field Drive folder override; must match the field config)
Headers:
  • Content-Type
  • Content-Length
Notes:
  • Files inherit permissions from the parent folder (no public sharing).
  • If a form requires auth, the upload endpoint enforces authentication.