OOOC Fête Finder imports event data from Google Sheets, supporting both private sheets (via service account) and public sheets (via CSV export URL). The integration fetches structured event data and converts it to CSV format for processing.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/KingPsychopath/oooc-fete-finder/llms.txt
Use this file to discover all available pages before exploring further.
Authentication methods
The integration supports two authentication strategies:- Service Account - For private sheets with full API access
- Public URL - For publicly accessible sheets via CSV export
Service account authentication
Service account authentication provides full access to private Google Sheets using OAuth 2.0 with JWT.Create service account
- Go to Google Cloud Console
- Create or select a project
- Navigate to IAM & Admin > Service Accounts
- Click Create Service Account
- Download the JSON key file
Share sheet with service account
- Open your Google Sheet
- Click Share
- Add the service account email (found in JSON key)
- Grant Viewer permissions
Public URL authentication
For public sheets, use the CSV export URL format:Implementation details
Service account flow
The service account authentication flow (lib/google/sheets/api.ts:42-83):- Load service account credentials from environment
- Create JWT with RS256 signature
- Exchange JWT for access token at
https://oauth2.googleapis.com/token - Use access token to fetch sheet data via Sheets API v4
- Convert response to CSV format
API endpoints
The integration uses these Google API endpoints:- Token exchange:
POST https://oauth2.googleapis.com/token - Sheets data:
GET https://sheets.googleapis.com/v4/spreadsheets/{sheetId}/values/{range} - Public CSV:
GET https://docs.google.com/spreadsheets/d/{sheetId}/export?format=csv&range={range}
Fetch strategies
ThefetchGoogleSheetsData function (lib/google/sheets/api.ts:344-397) tries strategies in order:
Service account (private sheets)
If
GOOGLE_SHEET_ID and GOOGLE_SERVICE_ACCOUNT_KEY are set, use OAuth 2.0 JWT flow to fetch data via Sheets API.CSV conversion
The integration converts Sheets API response to CSV format (lib/google/sheets/api.ts:201-241):- Normalizes rows to match header width
- Pads missing trailing cells with empty strings
- Escapes quotes and wraps cells containing commas, newlines, or quotes
- Handles null/undefined values as empty strings
Configuration
Environment variables
| Variable | Required | Description |
|---|---|---|
GOOGLE_SHEET_ID | Optional | Sheet ID extracted from URL |
GOOGLE_SERVICE_ACCOUNT_KEY | Optional | Compact JSON string with client_email and private_key |
REMOTE_CSV_URL | Optional | Direct CSV export URL for public sheets |
At least one of
REMOTE_CSV_URL or both GOOGLE_SHEET_ID + GOOGLE_SERVICE_ACCOUNT_KEY must be configured for the integration to work.Timeouts and limits
- Token exchange timeout: 10 seconds
- Sheets API timeout: 15 seconds
- Public CSV timeout: 15 seconds
- Default range:
A:Z(all rows, columns A through Z)
Usage in admin panel
The admin panel uses the integration to import event data:- Navigate to Admin > Events > Import
- The system automatically fetches data using configured strategy
- Preview imported events before committing to database
- Validation runs on all imported rows
Error handling
Common errors and solutions:API reference
The unified API is exported from lib/google/sheets/api.ts:402-408:Methods
fetchSheetsData(remoteUrl, sheetId, range)- Main fetch function with fallback strategiesbuildSheetsUrl(sheetId, range)- Build public CSV export URLextractSheetId(input)- Extract sheet ID from URL or validate direct IDfetchPublicCSV(targetUrl)- Fetch public CSV without authenticationfetchWithServiceAccount(sheetId, range)- Fetch using service account OAuth 2.0