The setup CLI walks you through all of this interactively. These guides are for manual configuration or reference.
Google OAuth Setup
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
External.
- Enter your contact information.
- Agree to the User Data policy and click
Create.
-
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:
- Go to Audience.
- In
Test users, click +Add users and enter your email.
-
Enable required APIs:
Google PubSub Setup
Automated Setup: If you ran inbox-zero setup-google, the Pub/Sub topic and subscription were created automatically. Skip to the “For local development” section below.
PubSub enables real-time email notifications. Follow the official guide:
- Create a topic
- Create a subscription
- Grant publish rights on your topic
Set GOOGLE_PUBSUB_TOPIC_NAME in your .env file.
When creating the subscription, select Push and set the URL to:
https://yourdomain.com/api/google/webhook?token=TOKEN
Set GOOGLE_PUBSUB_VERIFICATION_TOKEN in your .env file to the value of TOKEN.
For local development, use ngrok to expose your local server:
Then update the webhook endpoint in the Google PubSub subscriptions dashboard.
Microsoft OAuth Setup
Go to Microsoft Azure Portal and create a new app registration:
-
Navigate to Azure Active Directory > “App registrations” > “New registration”.
-
Choose a name and select a supported account type:
- Multitenant (default): allows any Microsoft account
- Single tenant: restricts to your organization
-
Set the Redirect URI:
- Platform: Web
- URL:
http://localhost:3000/api/auth/callback/microsoft (replace with your domain in production)
-
Click “Register”.
-
In “Authentication”, add additional redirect URIs (replace
localhost:3000 with your domain in production):
http://localhost:3000/api/outlook/linking/callback
http://localhost:3000/api/outlook/calendar/callback (optional)
http://localhost:3000/api/outlook/drive/callback (optional)
-
Get credentials from the Overview tab:
- Copy “Application (client) ID” →
MICROSOFT_CLIENT_ID
- For single tenant, copy “Directory (tenant) ID” →
MICROSOFT_TENANT_ID
- Go to “Certificates & secrets” > “New client secret” > copy the Value →
MICROSOFT_CLIENT_SECRET
-
Configure API permissions:
- Go to “API permissions” > “Add a permission” > “Microsoft Graph” > “Delegated permissions”
- Add:
openid, profile, email, User.Read, offline_access, Mail.ReadWrite, Mail.Send, MailboxSettings.ReadWrite, Calendars.Read, Calendars.ReadWrite, Files.ReadWrite
- Click “Grant admin consent” if you’re an admin.
LLM Setup
In your .env file, uncomment one of the LLM provider blocks and add your API key:
Users can also change the model in the app on the Settings page.
API keys require billing credits on the provider’s platform. A ChatGPT Plus or Claude Pro subscription does not include API access.