Prerequisites
- A Google Cloud project with billing enabled
- Gmail API, Google Drive API, and Cloud Pub/Sub API enabled
- A publicly reachable HTTPS URL
Register an Application
To establish the connection, you first need to set up an OAuth application in the Google Cloud Console:1
Configure OAuth Consent Screen
Go to APIs & Services > OAuth consent screen. Select External (or Internal), fill in required fields, and add the scopes needed:
- Gmail:
https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/gmail.send - Drive:
https://www.googleapis.com/auth/drive.readonly,https://www.googleapis.com/auth/drive.file
2
Create Credentials
Go to APIs & Services > Credentials > Create Credentials > OAuth client ID.
- Type: Web application
- Name:
apowerb-integration - Authorized redirect URIs:
https://your-domain.com/api/v1/auth/callback
3
Save Credentials
Download the JSON credentials or copy the Client ID and Client Secret.
Infrastructure Setup
1
Enable the APIs
2
Create the topic
3
Permissions
4
Create the push subscription
Setup
1
Configure the environment
Set the following
GOOGLE_INTEGRATION_* variables in your environment:GOOGLE_INTEGRATION_CLIENT_ID: Your Client IDGOOGLE_INTEGRATION_CLIENT_SECRET: Your Client SecretGMAIL_PUBSUB_PROJECT_ID: Your GCP project IDGMAIL_PUBSUB_TOPIC:gmail-notifications
2
Connect services
From the interface, navigate to Integrations and select Google. Connect your account using the configured credentials.
3
Subscribe to notifications
