coldflow logo
Skip to Content
Email Accounts

Google OAuth Setup

1. Create a Google Cloud Project

  1. Go to Google Cloud Console 
  2. Click “Create Project” or select an existing project
  3. Enter a project name and click “Create”

2. Enable Gmail API

  1. Navigate to APIs & Services > Library
  2. Search for “Gmail API”
  3. Click on “Gmail API” and click Enable
  1. Navigate to APIs & Services > OAuth consent screen
  2. Choose External (or Internal if using Google Workspace)
  3. Fill in required fields:
    • App name
    • User support email
    • Developer contact information
  4. Click Save and Continue
  5. On the Scopes page, click Add or Remove Scopes
  6. Add these scopes:
    • https://www.googleapis.com/auth/gmail.send
    • https://www.googleapis.com/auth/gmail.readonly
  7. Click Update then Save and Continue
  8. Add test users if needed, then Save and Continue

4. Create OAuth Credentials

  1. Navigate to APIs & Services > Credentials
  2. Click Create Credentials > OAuth client ID
  3. Choose Web application
  4. Enter an application name
  5. Add Authorized redirect URIs:
    • http://localhost:3000/oauth/callback (for local development)
    • Add your production URL if applicable
  6. Click Create
  7. Copy your Client ID and Client Secret

5. Configure Environment Variables

Add the following to your .env file:

GOOGLE_CLIENT_ID=your-client-id-here GOOGLE_CLIENT_SECRET=your-client-secret-here

Your Client ID will look like:

536726988839-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com

6. Connect Your Email Account

Once configured, you can connect your email account from the Email Accounts dashboard.

Last updated on