api-integration-patterns

Implements retry, circuit breaking, timeout budgeting, and idempotency patterns for external API clients.

1|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/dominionism/Noesis --skill api-integration-patterns-dominionism
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-integration-patterns
Source: https://github.com/dominionism/Noesis/tree/main/assets/skills/api-integration-patterns
Command: npx skills add https://github.com/dominionism/Noesis --skill api-integration-patterns-dominionism

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Integrating third-party APIs without resilience patterns leads to duplicate charges, hung requests, leaked credentials, and unhandled rate limits. This Skill provides concrete TypeScript patterns for consuming external APIs safely. ## Core Features & Use Cases - Resilient API Clients: Wrap every external API behind a dedicated client module with retry, circuit breaking, timeouts, and error mapping built in. - Idempotency & Webhook Security: Use deterministic idempotency keys for non-idempotent operations and verify webhook signatures with timing-safe HMAC comparison. - Use Case: When integrating Stripe payments into a checkout flow, apply timeout budgeting across inventory, payment, and email calls, use idempotency keys to prevent duplicate charges on retry, and map Stripe errors to internal domain errors. ## Quick Start Review my third-party API integration code and apply the retry, circuit breaker, timeout, and idempotency patterns to make it resilient.

Frequently Asked Questions about api-integration-patterns

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

FAQPage Schema
How do I add retry logic to third-party API calls in TypeScript?▼

Wrap the API call in a withRetry helper that accepts maxRetries and an isRetryable predicate, retrying only transient errors like 500, 502, and 503 responses. Combine it with a circuit breaker so repeated failures short-circuit instead of hammering the external service.

How do I prevent duplicate charges when retrying payment API requests?▼

Use idempotency keys derived deterministically from the operation identity, such as charge-{orderId}, and pass them to the provider's API. The same key across retries lets the provider deduplicate, so retries never create duplicate charges or emails.

Should I use an official SDK or raw HTTP for API integration?▼

Use the official SDK if it exists and is actively maintained, wrapping it in your own client class. Prefer raw HTTP when the SDK is unmaintained, has unpatched CVEs, or you need only one or two endpoints with precise control over headers and timeouts.

How do I verify webhook signatures securely?▼

Compute an HMAC-SHA256 over the timestamp and raw request body, then compare it to the signature header using crypto.timingSafeEqual rather than ===. Also enforce a timestamp tolerance window, typically five minutes, to block replay attacks.

What happens when an external API rate limits my requests?▼

Respect the Retry-After header and wait before retrying, but cap the wait with a maximum budget so callers are not blocked indefinitely. Log rate limit events as warnings since they signal you may need to optimize call patterns or request a higher limit.