Install the SDK
- TypeScript
Agent Lifecycle
Your agent follows a five-step lifecycle:Complete Example
Key Difference from Direct OAuth
Your agent must be registered and approved before it can initiate any OAuth flow. This is the “app-side authorization” — the gateway ensures only known, vetted agents can access services. Together with the user’s OAuth consent, this completes the ATH trusted handshake.Error Handling
The SDK throwsATHClientError for all error cases:
| Code | Meaning |
|---|---|
INVALID_ATTESTATION | Agent identity verification failed |
AGENT_NOT_REGISTERED | Agent must register before authorizing |
AGENT_UNAPPROVED | Agent registration was denied |
PROVIDER_NOT_APPROVED | Agent not approved for this provider |
SCOPE_NOT_APPROVED | Agent not approved for requested scopes |
SESSION_NOT_FOUND | OAuth session not found |
SESSION_EXPIRED | OAuth session has expired |
TOKEN_REVOKED | ATH access token has been revoked |
AGENT_IDENTITY_MISMATCH | Agent ID doesn’t match token binding |
USER_DENIED | User denied OAuth consent |
OAUTH_ERROR | Upstream OAuth provider error |
Next Steps
SDK Reference
See all available SDKs
Deploy a Gateway
Set up a gateway for your agent to connect to