Google Overview
Google Connectors
Sercha provides connectors for Google services: Gmail, Google Drive, and Google Calendar. All Google connectors use OAuth 2.0 for authentication, requiring you to create an OAuth client in the Google Cloud Console.
Available Connectors
| Connector | Description | Documentation |
|---|---|---|
| Gmail | Index emails from Gmail | Gmail Connector |
| Google Drive | Index files and Google Docs | Drive Connector |
| Google Calendar | Index calendar events | Calendar Connector |
Currently, if you want to add more than one Google account, you can reuse the same OAuth client credentials, but you must:
- Add each additional account as a test user in Google Cloud Console
- Run
sercha auth addseparately for each account (re-entering the same Client ID and Secret)
This is a known limitation for this individual-focused CLI tool.
OAuth Setup
All Google connectors share the same OAuth client. You only need to create one OAuth application in Google Cloud Console.
- Personal Google Account
- Google Workspace
Personal Account Setup
For personal Google accounts (non-Workspace), follow these steps to create an OAuth client.
Creating the OAuth Client
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services > OAuth consent screen
Configure Consent Screen
- Select External user type
- Fill in the required fields:
- App name:
Sercha(or your preferred name) - User support email: Your email address
- Developer contact email: Your email address
- App name:
- Click Save and Continue
- On the Scopes page, click Save and Continue (scopes are configured per connector)
- On the Test users page, add your Google account email address
- Click Save and Continue
If you need to add Google accounts outside of this Google Cloud project (e.g., a second personal account), add them as test users on the Test users page.
Create OAuth Credentials
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Desktop app as the application type
- Enter a name (e.g.,
Sercha Desktop) - Click Create
- Copy the Client ID and Client Secret
Google Workspace Setup
For Google Workspace (formerly G Suite) organisations, you can create an Internal application that doesn't require verification.
Admin Requirements
Creating an OAuth client for Workspace requires:
| Permission | Purpose |
|---|---|
| Cloud Console access | Create and manage the project |
| OAuth consent screen configuration | Set up the app for your organisation |
Domain-wide delegation is not required for Sercha. Each user authenticates with their own account.
Creating the OAuth Client
- Go to Google Cloud Console
- Ensure you're in the correct organisation (check the dropdown at the top)
- Create a new project or select an existing one
- Navigate to APIs & Services > OAuth consent screen
Configure Consent Screen
- Select Internal user type
- This restricts the app to users within your Workspace organisation
- No app verification required
- No test user configuration needed
- Fill in the required fields:
- App name:
Sercha - User support email: Your admin email or a group alias
- Developer contact email: Your admin email
- App name:
- Click Save and Continue
- On the Scopes page, click Save and Continue (scopes are configured per connector)
If you need to add Google accounts outside of this Workspace organisation, change the user type to External and add them as test users.
Create OAuth Credentials
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Desktop app as the application type
- Enter a name (e.g.,
Sercha Desktop) - Click Create
- Copy the Client ID and Client Secret
Enable Required APIs
Before using each connector, you must enable the corresponding Google API. Enable only the APIs for connectors you plan to use.
| Connector | API to Enable | Enable Link |
|---|---|---|
| Gmail | Gmail API | Enable Gmail API |
| Google Drive | Google Drive API | Enable Drive API |
| Google Calendar | Google Calendar API | Enable Calendar API |
For each API:
- Click the link above (or search in the API Library)
- Ensure you're in the correct project
- Click Enable
OAuth URLs
Sercha uses these OAuth endpoints for Google authentication:
| Setting | Value |
|---|---|
| Authorization URL | https://accounts.google.com/o/oauth2/v2/auth |
| Token URL | https://oauth2.googleapis.com/token |
| Callback URL | http://localhost:18080/callback |
Sercha runs a temporary local server on port 18080 to receive the OAuth callback during the authorisation flow.
Registering with Sercha
After creating your OAuth client, register it with Sercha:
sercha auth add \
--provider google \
--name "My Google Account" \
--client-id "YOUR_CLIENT_ID" \
--client-secret "YOUR_CLIENT_SECRET"
This will open your browser to complete the Google authorisation flow. After authorising, you can create sources for Gmail, Drive, and Calendar using this authorisation.
Rate Limiting
Google APIs have per-user and per-project quotas. Sercha implements rate limiting to stay within these limits:
| Service | Rate Limit | Burst |
|---|---|---|
| Gmail | 2 requests/second | 5 |
| Google Drive | 8 requests/second | 10 |
| Google Calendar | 5 requests/second | 10 |
These are conservative defaults well below Google's actual limits to avoid quota exhaustion.
References
Next
- Gmail Connector - Index emails
- Google Drive Connector - Index files and documents
- Google Calendar Connector - Index calendar events