api-client-patterns

Implement axios HTTP client patterns with interceptors, retry logic, and type safety.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/BPMSTC/websiteagent --skill api-client-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-client-patterns
Source: https://github.com/BPMSTC/websiteagent/tree/main/.claude/skills/api-client-patterns
Command: npx skills add https://github.com/BPMSTC/websiteagent --skill api-client-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HTTP client development often repeats boilerplate for each API, leading to inconsistent error handling and fragile integrations. This skill provides a standardized, reusable pattern library for building API clients that centralizes configuration, interceptors, and error transformation.

Core Features & Use Cases

  • Centralized configuration with a reusable axios instance (base URL, timeout, headers).
  • Request/response interceptors for authentication, logging, and consistent error handling.
  • Retry logic, cancellation support, and streaming capabilities for long-running calls.
  • Use cases include building clients for multiple services, third-party integrations, and internal tooling with predictable error semantics.

Quick Start

Install and import the API client module to start making typed requests to your backend.

Frequently Asked Questions about api-client-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an HTTP client with consistent error handling and retry logic?

Use a standardized axios instance with centralized configuration, request and response interceptors, and retry logic to build an HTTP client with consistent error handling that ensures reliable API calls across web applications and microservices.

What's the best way to manage API configuration across multiple microservices?

Manage API configuration across multiple microservices by centralizing base URLs, timeouts, and headers in a reusable axios instance, ensuring predictable error semantics and consistent behavior across all service integrations.

How do axios interceptors work for authentication and logging in API clients?

Axios interceptors intercept outgoing requests and incoming responses to inject authentication tokens, execute logging operations, and apply consistent error transformation before the response reaches the application, ensuring reliable API calls.

Can I implement cancellation and streaming support for long-running API calls?

You can implement cancellation and streaming support for long-running API calls using these axios client patterns, which specify optional streaming capabilities and cancellation support to manage sustained HTTP connections and prevent hanging requests.

Does this API client pattern work for both frontend and backend services?

This API client pattern works for both frontend and backend services needing reliable API calls, applying standardized configuration, type safety, interceptors, and error transformation across web applications and microservices to ensure consistent integrations.

Why does my HTTP client need centralized error transformation?

Your HTTP client needs centralized error transformation to eliminate repeated boilerplate and inconsistent error handling across APIs, providing predictable error semantics for frontend and backend integrations while preventing fragile application logic.