Skip to main content

Token Types

Auth-Agent issues two types of tokens:

Access Token

Short-lived JWT for API access (1 hour)

Refresh Token

Long-lived token for refreshing access (30 days)

Token Lifecycle

Access tokens automatically refresh before expiration with the SDK.
import { useAuth } from 'ai-auth';

function MyComponent() {
  const { getAccessToken } = useAuth();
  
  // Always returns valid token (auto-refreshes if needed)
  const token = getAccessToken();
}
[Documentation in progress…]