Gmail OAuth in 3 lines
OAuth for Email
Simplified
Your users authenticate once. You get tokens to read and send emails.
Integration
Three steps. That's it.
integration.js
// 1. Redirect user to authenticate
window.location.href = 'https://inbox.dog/oauth/authorize?' +
'client_id=YOUR_KEY&redirect_uri=YOUR_CALLBACK';
// 2. Exchange code for token (in your backend)
const response = await fetch('https://inbox.dog/oauth/token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
code: 'AUTH_CODE_FROM_CALLBACK',
client_id: 'YOUR_KEY',
client_secret: 'YOUR_SECRET'
})
});
const { access_token } = await response.json();
// 3. Use token with Gmail API
const emails = await fetch(
'https://gmail.googleapis.com/gmail/v1/users/me/messages',
{ headers: { Authorization: `Bearer ${access_token}` } }
); Why inbox.dog
Everything you need
Complete OAuth Flow
We handle the entire Google OAuth dance. You just redirect and receive tokens.
Gmail API Access
Get tokens that work directly with Gmail API. Read emails, send messages, manage labels.
Token Refresh
Automatic token management. Refresh tokens when they expire without user intervention.
Usage-Based Billing
Pay only for what you use. $0.10 per OAuth flow. Start with 10 free credits.
Standard OAuth 2.0
Familiar OAuth 2.0 endpoints. Works with any HTTP client or OAuth library.
Open Source
Self-host if you prefer. MIT licensed. Full source code on GitHub.
10 free credits to start
Ready to ship?
Create your API key and start authenticating users in minutes.
Read the Docs