Google Drive
Overview
Pre-built tooling
Pre-built integrations
Access requirements
Pre-Requisites | Status | Comment |
---|---|---|
Paid dev account | Not required | Basic Google Cloud account is sufficient |
Paid test account | Not required | |
Partnership | ❓ | |
App review | ❓ | |
Security audit | ❓ |
Pre-built Google Drive Integration Overview
Nango’s pre-built Google Drive integration allows you to sync specific files and folders that your users select. The integration uses the following components:
- OAuth Flow: Handle authentication using Nango’s SDK
- Google Drive Picker: Let users select files and folders to sync
- Document Sync: Sync metadata for selected files and folders
- Document Fetching: Download individual file contents as needed
Complete Implementation Guide
1. Initial Setup
Prerequisites Before getting started, ensure you have:
- A Google Cloud project with Drive API enabled
- Google Drive Picker API enabled
- Required credentials:
- Google App ID
- OAuth Client ID
- Picker API Key
2. Configure OAuth & Drive Picker
Set the following scope in your Nango configuration:
In your frontend, run the OAuth flow with nango.auth
and show the Google drive picker to your user.
Note: Replace the placeholders with your actual credentials:
<GOOGLE_APP_ID>
: Your Google Cloud project number<GOOGLE_CLIENT_ID>
is the client id of your Google OAuth app<GOOGLE_PICKER_API_KEY>
: Your Drive Picker API key
3. Update Connection Metadata
After users select files/folders, update the connection metadata using the Nango SDK:
4. Trigger Document Sync
Re-trigger the sync in the dashboard, or with the API to fetch metadata for selected files:
5. Fetch Individual Files
To download specific files, use the appropriate action based on file type:
File Type Support
The integration supports different file types through specific actions:
- Regular files (PDFs, images, etc.): Use
google-drive
provider withfetch-document
action - Google Docs: Use
google-docs
provider withfetch-document
action - Google Sheets: Use
google-sheets
provider withfetch-document
action
Note: The same OAuth credentials work across all these providers.
Common Issues and Solutions
-
Empty Records: If
/documents
returns empty records, ensure you’ve:- Successfully completed the OAuth flow
- Updated the connection metadata with file/folder IDs
- Triggered the sync after updating metadata
-
Access Token:
- Always get the access token from Nango’s connection endpoint
- Use the token to initialize the Google Picker
- Handle token refresh automatically through Nango
-
Action Timeouts: If
fetch-document
actions timeout:- Verify you’re using the correct provider for the file type
- Check the file permissions in Google Drive
- Ensure the file size does not exceed 10MB
Useful Links
- Google Drive access token specs
- Google Drive OAuth scopes
- Google Drive Picker setup guide
- Finding your Google App ID
API Gotchas
- Most Google Drive scopes are “restricted scopes” requiring Google’s security review before production use.
- The
drive.file
scope is an exception and doesn’t require review, but only allows access to files explicitly selected via the Picker. - Files must be selected via the Google Drive Picker to be accessible through the integration.
- Different file types (Docs, Sheets) require different provider configurations but can share the same OAuth credentials.
- Use the access token from Nango’s connection for Google Picker.
- Store file IDs in the connection metadata after selection.
Need help? Join our community for support.
Was this page helpful?