Quick Setup with CLI: If you have the gcloud CLI installed, run inbox-zero setup-google to automate API enabling and Pub/Sub setup. It will guide you through the OAuth steps that require manual console access.
Go to Google Cloud Console and create a new project if necessary.
-
Configure consent screen:
- Go to Credentials. If the banner shows up, click it and then click
Get Started.
- Choose a name for your app and enter your email.
- In Audience, choose a user type:
- Internal — Google Workspace only. All members of your organization can sign in without additional setup. Personal Gmail accounts cannot use Internal apps.
- External — any Google account, including personal Gmail. You’ll need to add yourself as a test user (see step 5 below).
- Enter your contact information.
- Agree to the User Data policy and click
Create.
If you chose External: since your app is unverified (normal for self-hosted), you must add yourself as a test user (see step 5 below) before you can sign in. You’ll also see a “This app isn’t verified” warning screen when signing in — click “Advanced” then “Go to [app name]” to proceed.
-
Create OAuth credentials:
- Click
+Create Credentials > OAuth Client ID.
- Application Type:
Web application.
- Authorized JavaScript origins:
http://localhost:3000 (replace with your domain in production)
- Authorized redirect URIs (replace
localhost:3000 with your domain in production):
http://localhost:3000/api/auth/callback/google
http://localhost:3000/api/google/linking/callback
http://localhost:3000/api/google/calendar/callback (optional, for calendar)
http://localhost:3000/api/google/drive/callback (optional, for Drive)
- Click
Create and copy the Client ID and secret.
-
Update
.env file:
- Set
GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.
-
Update scopes:
- Go to
Data Access in the sidebar.
- Click
Add or remove scopes.
- Manually add these scopes:
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.settings.basic
https://www.googleapis.com/auth/contacts
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/drive.file
- Click
Update, then Save.
-
Add yourself as a test user (External only):
- Go to Audience.
- In
Test users, click +Add users and enter your email.
Skip this step if you chose Internal — all org members can sign in automatically.
-
Enable required APIs:
Next step for real-time notifications: Google PubSub