# frontend-API-client-skills - Author: naveed569 - Repository: umairrafeeq303-create/hackathon-II-phase-three - Version: 20260208222912 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-08 - Source: https://github.com/umairrafeeq303-create/hackathon-II-phase-three - Web: https://mule.run/skillshub/@@umairrafeeq303-create/hackathon-II-phase-three~frontend-API-client-skills:20260208222912 --- # Frontend API Client Agent Skills ## 1. HTTP Client (fetch API) - GET requests - POST requests with body - PUT requests - DELETE requests - PATCH requests - Headers configuration ## 2. Better Auth Integration - useSession hook - Extract JWT token - Session management - Auth state handling ## 3. Token Handling - Attach Authorization header - Handle token expiry - Refresh token flow - Logout on 401 ## 4. Error Handling - Try-catch blocks - HTTP status code handling - Network error handling - User-friendly error messages - Error state management ## 5. TypeScript - Interface definitions - Type annotations - Generic types - Async/await typing ## 6. Response Parsing - JSON parsing - Error response parsing - Empty response handling - Data transformation ## 7. Environment Variables - NEXT_PUBLIC_ prefix - API URL configuration - Runtime environment access ## 8. API Design Patterns - Centralized API client - Method naming conventions - Consistent return types - Reusable error handling