API Auth Integration Models
API Auth Apps are for one specific job: letting your customers safely create and manage API keys for your product. Most teams get stuck on one early choice: should key management live in a ready-made portal, or inside your product’s custom UX? This page gives you a practical way to decide.Two valid models
Vanity model
You expose a dedicated API Auth management surface (like yourvanity-pages implementation) and hand users into it with a short-lived access ticket.
This works best when:
- You need to ship quickly.
- You want battle-tested key lifecycle UX first.
- Your product team is still validating API customer behavior.
Custom model
You build key management directly into your own product flows using hooks (useApiAuthAppSession, useApiAuthKeys, audit hooks).
This works best when:
- Key management must be embedded in existing settings pages.
- You need complex internal policy/approval gates.
- You have mature product requirements and stable IA.
Shared security flow (both models)
Regardless of UI model, keep this exact trust boundary:- User authenticates in your app.
- Your backend authorizes that user for API key management.
- Backend issues short-lived
api_auth_accessticket. - Frontend exchanges ticket with
/session/ticket/exchange. - Frontend calls
/api-auth/*endpoints with that session.
First step most teams miss: create the API Auth app
You must create the API Auth app before issuing tickets or rendering vanity/custom UI.app_slugnamekey_prefix
app_slug = aa_<deploymentId>.
Decision matrix
| Constraint | Prefer Vanity | Prefer Custom |
|---|---|---|
| Time-to-market | Strong fit | Slower |
| UX control | Medium | Full |
| Product complexity | Low/medium | Medium/high |
| Initial maintenance | Lower | Higher |
| Differentiated experience | Moderate | High |
What to lock before implementation
- Key scope model: user, org, or workspace.
- Expiry policy: optional vs mandatory.
- Rotation policy: manual only vs required cadence.
- Revocation authority: owner-only vs admin override.
- Audit requirements: what your support/security teams must see.
Practical recommendation
For most SaaS teams:- Launch with vanity pages.
- Learn customer behavior for 1-2 release cycles.
- Move high-value flows to custom UX where needed.
Related docs
- API Auth vanity implementation
- API Auth custom hook implementation
- React Router
useApiAuthAppSession - React Router
useApiAuthKeys - API Keys Backend API Reference
Go-live checklist
- RBAC gate for ticket issuance is enforced server-side.
- Ticket expiry is short and validated.
- Key create/rotate/revoke flows verified in staging.
- Audit logs visible to support/security owners.
- Customer-facing key handling docs are published.
