Building Your App › Integrations
Google Suite Integration
Connect Gmail, Calendar, Drive, and more
What is Google Suite?
Google Suite (now called Google Workspace) includes Gmail, Google Calendar, Google Drive, Sheets, Docs, and more. You can integrate these into your app.
Perfect for:
- Sending emails via Gmail
- Managing calendar appointments
- Storing files in Google Drive
- Reading/writing Google Sheets
- Accessing Google Docs
What You'll Need
Google Account
Any Google account works
Google Cloud Console
Create a project (free!)
Enable APIs
Turn on the Google services you need
Get Credentials
Create OAuth credentials
20-30 Minutes
A few key steps involved, but we'll guide you!
Tip
Here's a helpful video to get you started.
Step 1: Set Up Google Cloud Project
Create Project
- Go to console.cloud.google.com
- Click New Project (top right)
- Name it (like "My App")
- Click Create
- Wait for project to be created
- Make sure you're in the new project (check top navbar)
Enable APIs
Depending on what you need:
For Gmail:
- Search for "Gmail API" in search bar
- Click on it
- Click Enable
For Google Calendar:
- Search for "Google Calendar API"
- Click Enable
For Google Drive:
- Search for "Google Drive API"
- Click Enable
For Google Sheets:
- Search for "Google Sheets API"
- Click Enable
Tip
Only enable what you need! You can always add more later.
Create OAuth Credentials
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- If prompted, Configure Consent Screen:
- Choose External
- App name: Your app name
- User support email: Your email
- Developer email: Your email
- Click Save and Continue
- Click Save and Continue through scopes
- Click Back to Dashboard
- Now create OAuth client:
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Name: "My App"
- Authorized redirect URIs:
[emergent-preview-link]/auth/callback(Ask the agent which URI value to input) - Click Create
- Copy these credentials:
- Client ID
- Client Secret
Warning
Keep Client Secret safe! Don't share it publicly.
Step 2: Tell the Agent What You Want
Describe which Google services you need:
Example 1: Gmail Integration
I want to send emails through Gmail API.
Google Cloud credentials:
- Client ID: xxxxx.apps.googleusercontent.com
- Client Secret: xxxxx
Features:
- Send emails from my Gmail account
- Read inbox (optional)
- Search emails (optional)
Please set this up with OAuth authentication.
Example 2: Google Calendar
Integrate Google Calendar for appointment booking.
Google Cloud credentials:
- Client ID: xxxxx.apps.googleusercontent.com
- Client Secret: xxxxx
Features:
- View user's calendar
- Create appointments
- Update/cancel appointments
- Send calendar invites
- Check availability
Please build this with OAuth.
Example 3: Google Drive
Use Google Drive for file storage.
Google Cloud credentials:
- Client ID: xxxxx.apps.googleusercontent.com
- Client Secret: xxxxx
Features:
- Upload files to user's Drive
- List their files
- Download files
- Share files
- Create folders
Please set this up.
Example 4: Google Sheets as Database
Use Google Sheets as a simple database.
Google Cloud credentials:
- Client ID: xxxxx.apps.googleusercontent.com
- Client Secret: xxxxx
Sheet setup:
- Sheet name: "Customer Database"
- Columns: Name, Email, Phone, Status
Features:
- Read data from sheet
- Add new rows
- Update existing rows
- Display in app
Please build this.
Tip
OAuth Authentication: Users will click "Sign in with Google" to authorize your app.
Step 3: Test the Integration
After setup:
Click Preview
In Emergent, click Preview
Sign in with Google
Click the "Sign in with Google" button
Authorize
Google will ask for permissions
Click Allow
Test Feature
Try the feature:
- Send a test email
- Create a calendar event
- Upload a file
- Read from sheet
Check Google
Verify in Gmail/Calendar/Drive that it worked!
Common Questions
</Accordion> ## Something Not Working?OAuth Error
Tell the agent:
Getting OAuth error when signing in:
[paste error]
Can you check:
1. Client ID and Secret are correct
2. Redirect URI is configured
3. Scopes are properly set
Permission Denied
Tell the agent:
User authorizes but still getting permission errors.
Error: [paste error]
Can you check the OAuth scopes?
API Not Enabled
Tell the agent:
Getting "API not enabled" error.
Which API should I enable in Google Cloud Console?
Real Examples
Example 1: Appointment Booking System
Build appointment booking with Google Calendar.
Google Cloud credentials: [will provide]
Flow:
1. Show available time slots
2. User selects time
3. Create Google Calendar event
4. Send confirmation email via Gmail
5. Send calendar invite
Features:
- Check availability
- Block out busy times
- Automatic reminders
- Reschedule/cancel
Please build this.
Example 2: Email Campaign Tool
Send email campaigns through Gmail API.
Google Cloud credentials: [will provide]
Features:
- Upload recipient list
- Compose email template
- Send to all recipients
- Track opens/clicks
- Respect rate limits
Please set this up.
Example 3: Document Generator
Generate documents and save to Google Drive.
Google Cloud credentials: [will provide]
Flow:
1. User fills form
2. Generate PDF/document
3. Save to their Google Drive
4. Share link
Features:
- Template system
- PDF generation
- Automatic naming
- Organize in folders
Please build this.
Advanced Features
Service Account (No OAuth)
For server-to-server access:
Instead of OAuth, use Service Account.
Access my Google Sheet directly without user login.
Sheet ID: [provide]
Set up service account authentication.
Note
A spreadsheet ID can be extracted from its URL. For example, the spreadsheet ID in the URL https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 is "abc1234567".
Batch Operations
Optimize Google Sheets integration:
- Batch read/write operations
- Reduce API calls
- Update multiple rows at once
Webhooks
Get notified when:
- New email arrives
- Calendar event changes
- Drive file is modified
Set up Google webhooks.
Going to Production
Update Redirect URIs
- In Google Cloud Console → Credentials
- Edit your OAuth client
- Add production redirect URI:
https://yourdomain.com/auth/callback
- Click Save
Verify Your Domain
- In OAuth consent screen
- Click Add domain
- Add your domain
- Complete verification
Submit for Verification (If Needed)
If requesting sensitive scopes:
- Fill out security questionnaire
- Submit for Google review
- Usually takes 3-5 days
Quick Checklist
Before going live:
- All needed APIs enabled
- OAuth working in test
- Tested core features
- Added production redirect URI
- Verified domain (if needed)
- Submitted for review (if needed)
- Tested with real Google account
Remember
Free to use - No API costs
Generous limits - More than enough for most apps
OAuth for user data - Secure access
Service account for server - No user login needed
Setup takes time - But worth it!
Info
Stuck? Tell the agent: "I need help with Google [Gmail/Calendar/Drive/Sheets] integration" and describe the issue.
