Tango stores per-tenant OAuth connections in the host Ecto repo. Version 0.3.0 adds typed refresh errors, credential-free connection info, public generation locks, id-based revoke, and test fixtures. Both 0.2.0 and 0.3.0 use schema V03.
Inspect mix.exs, mix.lock, and the resolved Tango source before writing code. A local 0.3.0 version does not prove Hex publication; path dependencies have no Hex lock entry. Use the installed implementation when docs disagree. The 0.3 APIs below do not compile against 0.2.0; authorization completion requires 0.2.0 or later.
Route the request
Read only the references needed for the request:
| Request | Reference |
|---|---|
| Install, configure, first migration | references/bootstrap.md |
| Add or sync providers (Nango catalog, custom) | references/providers.md |
| Server-side redirect flow (no popup) | references/direct-flow.md |
| Popup completion, verifier, finalize, cleanup | references/authorization.md |
| Mount the HTTP router, CORS, API key | references/api.md |
| LiveView connect button | references/liveview.md, then references/authorization.md |
| Use, refresh, revoke, report auth failures | references/connections.md |
| Classify refresh errors, backoff, safe reporting | references/refresh-errors.md |
| Consumer test fixtures | references/testing.md |
| Upgrade 0.2 to 0.3, schema, or legacy callbacks | references/upgrading.md |
| Debug errors | references/debug.md |
For /tango help or an unknown/missing subcommand, list: bootstrap, providers, flow, authorization, api, liveview, connections, testing, upgrade, debug, and help. flow maps to references/direct-flow.md.
Safety boundaries
- Take tenant ids from the authenticated server session, never browser input. Locking does not authorize access. Tenant ids match
^[a-zA-Z0-9_-]+$, at most 255 bytes. - Keep credentials server-side. Do not log loaded connection/authorization structs, provider bodies, codes, raw state, completion handles, or credential-bearing changesets. Persist connection ids and selected identity fields in host records; fetch tokens only for provider calls.
- Use connection-info reads for status/identity and
Tango.Testingfor ordinary test inserts. Host token writes bypass Tango's query/telemetry redaction. - Use
RefreshError.classify/1for decisions andto_storage/1for reporting. Outages and database failures do not prove revoked consent. Only genuine resource API credential rejections belong inrecord_auth_failure/3. - Keep encryption/API keys in runtime secrets. Key rotation makes stored credentials unreadable. Never give the browser
TANGO_API_KEY: the HTTP router trusts its caller's tenant header. - For popup work, follow authorization.md: exact allowed origins, popup source/origin/intent checks, server-owned verifier, tenant-scoped completion, and finalization on Tango's configured Repo. Direct and staged sessions are not interchangeable.
mix tango.setupis initial installation only. Add pinned migrations only for schema advances; 0.2 to 0.3 stays V03. Tango schedules nothing; host cleanup runs authorizations before sessions.- Verify APIs against installed source. Preserve the requested dependency source and distinguish local validation from published adoption. See upgrading.md before release/dependency changes.
$ARGUMENTS