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:

  1. Open Google Cloud Console → create a new project (e.g. Heath Media Budget).
  2. Search “Gmail API” at the top → Enable.
  3. Left menu → APIs & Services → OAuth consent screen. Pick External, fill in app name, your email, save. Add scopes: gmail.readonly and userinfo.email. Add yourself as a test user.
  4. Left menu → APIs & Services → CredentialsCreate Credentials → OAuth Client ID → type Web application.
  5. Add this exact authorised redirect URI:https://budget.benheath.cc/api/integrations/gmail/callback
  6. Click Create → copy the Client ID and Client secret.
  7. 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.
  8. Refresh this page — Connect buttons will activate.

Connected mailboxes

Heath Media addresses scanned for incoming invoices

tom@heathmedia.co.uk
Tom — primary
Not connected Connect
content@heathmedia.co.uk
Content team
Not connected Connect

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/sync

Recommended cadence: every 15 minutes during business hours.