← Docs

How inbox.dog Works

inbox.dog is an OAuth proxy. It handles the Google OAuth 2.0 flow so you don't have to.

Architecture

┌─────────────┐    ┌──────────────┐    ┌─────────────┐
│  Your App   │───▶│  inbox.dog   │───▶│   Google    │
│             │◀───│              │◀───│   OAuth     │
└─────────────┘    └──────────────┘    └─────────────┘
  1. Your app redirects the user to inbox.dog/oauth/authorize
  2. inbox.dog redirects the user to Google's consent screen with the correct scopes and credentials
  3. The user authenticates with Google and grants permission
  4. Google redirects back to inbox.dog with an authorization code
  5. inbox.dog redirects the user to your redirect_uri with a short-lived code
  6. Your app exchanges that code for tokens via POST /oauth/token
  7. The tokens work directly with gmail.googleapis.com — inbox.dog is no longer in the path

What inbox.dog stores

Data Stored by inbox.dog Notes
Your API key (client_id, client_secret)YesIn Cloudflare KV
OAuth state (CSRF token)TemporarilyExpires after 10 minutes
Authorization codesTemporarilyExpires after 5 minutes
Access tokensNoReturned to you, never stored
Refresh tokensNoReturned to you, never stored
User emailsNoinbox.dog never reads email content

Security model

  • inbox.dog never sees or stores your users' emails, tokens, or email content
  • Tokens are passed through to your app and discarded
  • All traffic is HTTPS
  • OAuth state tokens prevent CSRF attacks
  • Authorization codes are single-use and expire in 5 minutes
  • The entire codebase is open source (MIT) — audit it yourself

Tech stack

  • Effect-TS — Type-safe error handling and services
  • Hono — Web framework for Cloudflare Workers
  • Astro — Static landing page and docs
  • Cloudflare Workers — Edge deployment, KV storage