Skip to main content

At a glance

  • Availability: Enabled by default.
  • Auth: OAuth 2.0.
  • Connection: A user authorizes the connection in the provider’s consent screen.
  • Scopes: https://www.googleapis.com/auth/drive.

Credentials

Set these per environment. See Connect an integration. With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.

Setup

  1. Create a Google Cloud Project: Go to the Google Cloud Console and create a new project
  2. Enable the Google Drive API: Navigate to APIs & Services > Library and enable the Google Drive API
  3. Configure OAuth Consent Screen: Go to APIs & Services > OAuth consent screen. Set up your app name, user support email, and developer contact. Add scope: drive (full access)
  4. Create OAuth 2.0 Client ID: Go to APIs & Services > Credentials. Click ‘Create Credentials’ > ‘OAuth client ID’. Choose ‘Web application’. Add authorized redirect URI: http://localhost:3000/api/auth/drive/callback (adjust port/domain for production)
  5. Copy Credentials to .env: Copy the Client ID and Client Secret to your .env file as GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
  6. Test the Integration: Start your application and navigate to /api/auth/drive to initiate the OAuth flow
  • The same Google OAuth credentials work for all Google services (Gmail, Calendar, Sheets, Drive)
  • In production, make sure to add your production callback URL to authorized redirect URIs
  • The drive scope grants full access to all files; tools like update_file and delete_file require it for files not created by this app
  • You may need to verify your app if you plan to distribute it publicly

Tools

Example prompts

  • Help me organize files in Google Drive by creating folders and moving files based on file types or names.
  • Search Google Drive for a specific file or document by name, type, or content.
  • Create a backup folder structure in Google Drive and organize important files.