What problem does it solve?
API-driven frontend applications often require repetitive boilerplate to configure Axios clients for multiple backend services, manage per-domain API calls, and implement consistent authentication and request signing. This skill provides a cohesive pattern for building and organizing API clients and service functions in src/lib/api/.
Core Features & Use Cases
- Axios Client Setup: Factory function to create domain-specific Axios instances configured for different microservices
- Service Functions: Async functions organized by domain that perform API calls (fetch, create, update, delete)
- Authentication & Signatures: Token retrieval, decryption, and inclusion in requests with HMAC-based signatures; support for multiple authentication patterns across services
- Domain Organization: Group API calls by domain (contacts, employees, IDM, MDM) to improve maintainability
- Use Case: When adding a new microservice, wire a new Axios client and corresponding service module quickly without duplicating logic
Quick Start
Create a new domain service by adding a dedicated folder, a factory Axios client, and a service file that implements at least one authenticated endpoint.