UNPKG

ai-auth

Version:

Complete Auth-Agent SDK - Agent authentication for AI developers + OAuth client integration for website developers

36 lines 888 B
/** * React hooks for Auth-Agent */ import type { UserInfo } from '../types'; /** * useUser hook * Get current user information with loading state */ export declare function useUser(): { user: UserInfo | null; isLoading: boolean; isAuthenticated: boolean; error: Error | null; }; /** * useAccessToken hook * Get current access token */ export declare function useAccessToken(): string | null; /** * useAuthenticatedFetch hook * Wrapper around fetch that automatically adds Authorization header */ export declare function useAuthenticatedFetch(): (url: string, options?: RequestInit) => Promise<Response>; /** * useAuthCallback hook * Handle OAuth callback in a component */ export declare function useAuthCallback(): { isHandling: boolean; result: { user?: UserInfo; error?: Error; } | null; }; //# sourceMappingURL=hooks.d.ts.map