Aurinko — Production-grade Elixir client for the Aurinko Unified Mailbox API.
Overview
Aurinko provides a unified API for Email, Calendar, Contacts, Tasks, Webhooks, and Booking across Google Workspace, Office 365, Outlook, MS Exchange, Zoho, and iCloud.
Features
- Full Unified API coverage (Email, Calendar, Contacts, Tasks, Webhooks, Booking)
- ETS-backed response caching with TTL and LRU eviction (
Aurinko.Cache) - Token-bucket rate limiting with per-account and global RPS caps (
Aurinko.RateLimiter) - Circuit breaker with half-open probing (
Aurinko.CircuitBreaker) - Automatic retry with exponential backoff + jitter
- Lazy stream-based pagination (
Aurinko.Paginator) - High-level sync orchestration (
Aurinko.Sync.Orchestrator) - Webhook HMAC-SHA256 signature verification (
Aurinko.Webhook.Verifier) - Telemetry events +
Telemetry.Metricsdefinitions (Aurinko.Telemetry) - Typed response structs for all resources
- NimbleOptions config validation
Quick Start
config :aurinko,
client_id: System.get_env("AURINKO_CLIENT_ID"),
client_secret: System.get_env("AURINKO_CLIENT_SECRET")
# Auth
url = Aurinko.authorize_url(service_type: "Google", scopes: ["Mail.Read"],
return_url: "https://myapp.com/callback")
{:ok, %{token: token}} = Aurinko.Auth.exchange_code(code)
# Email
{:ok, page} = Aurinko.list_messages(token, q: "is:unread", limit: 25)
# Stream all pages lazily
Aurinko.Paginator.stream(token, &Aurinko.list_messages/2)
|> Stream.each(&process/1)
|> Stream.run()
# Calendar
{:ok, event} = Aurinko.create_event(token, "primary", %{
subject: "Standup",
start: %{date_time: ~U[2024-06-01 09:00:00Z], timezone: "UTC"},
end: %{date_time: ~U[2024-06-01 09:30:00Z], timezone: "UTC"}
})