Back to settings
Email integration
Auto-pull invoices from Gmail. Sync runs read-only — Budget never sends or modifies your mail.
Set up Google OAuth (one-time)
You need a Google Cloud OAuth client. Steps:
- Open Google Cloud Console → create a new project (e.g. Heath Media Budget).
- Search “Gmail API” at the top → Enable.
- Left menu → APIs & Services → OAuth consent screen. Pick External, fill in app name, your email, save. Add scopes:
gmail.readonlyanduserinfo.email. Add yourself as a test user. - Left menu → APIs & Services → Credentials → Create Credentials → OAuth Client ID → type Web application.
- Add this exact authorised redirect URI:
https://budget.benheath.cc/api/integrations/gmail/callback - Click Create → copy the Client ID and Client secret.
- On your Mac terminal:
ssh -t root@195.110.59.212 '/var/www/budget/scripts-set-google-oauth.sh'It prompts for both values (hidden), writes them to.env.local, reloads pm2. - Refresh this page — Connect buttons will activate.
Connected mailboxes
Heath Media addresses scanned for incoming invoices
Cron sync
Optional periodic sync — runs without an active session.
With CRON_SECRET set in .env.local, schedule:
curl -X POST -H "X-Cron-Secret: $CRON_SECRET" https://budget.benheath.cc/api/integrations/gmail/syncRecommended cadence: every 15 minutes during business hours.