external-api-integration

Configure Faraday clients with timeouts, retries, and sanitized logging for Rails API integrations.

21|2|Updated May 24, 2026
One-click install
npx skills add https://github.com/sandeepmvl/rails-skills --skill external-api-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: external-api-integration
Source: https://github.com/sandeepmvl/rails-skills/tree/main/skills/32-external-api-integration
Command: npx skills add https://github.com/sandeepmvl/rails-skills --skill external-api-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common issue of AI agents generating unsafe, unreliable external API integration code for Rails applications, which leads to outages from missing timeouts, duplicate records from unhandled retries, credential leaks from unsanitized logging, and blocked user requests from synchronous external calls.

Core Features & Use Cases

  • Faraday client setup: Pre-configured HTTP client with open/read timeouts, retries for idempotent requests, and sanitized request/response logging to avoid credential leaks.
  • Circuit breaker protection: Stoplight-based circuit breaking for flaky upstream APIs to prevent retry storms from compounding outages.
  • Service object wrapper: Encapsulates all external API logic in reusable service objects to keep controllers and models clean.
  • Async job offloading: Moves external calls to background jobs to avoid blocking user-facing requests.
  • Test safety: VCR cassette configuration to record and replay API responses, eliminating real API calls in test suites.
  • Idempotency support: Guidance for adding idempotency keys to POST requests to prevent duplicate records on automatic retries. For example, use this Skill to integrate a CRM like HubSpot or payment processor like Stripe, ensuring all calls are retried safely, logged without exposing credentials, and never block user interactions.

Quick Start

Use the external-api-integration skill to build a production-ready HubSpot client with retries, circuit breaking, and background job offloading for your Rails app.

Frequently Asked Questions about external-api-integration

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

FAQPage Schema
How do I configure Faraday in Rails to retry idempotent requests safely?

To configure Faraday for safe retries, set up a pre-configured HTTP client with open and read timeouts, and enable retries exclusively for idempotent requests to prevent duplicate records. This approach ensures reliable external API integration without causing downtime.

Why does my Rails app block user requests during synchronous external API calls?

Synchronous external API calls block user requests because they execute within the web server cycle. Offloading external calls to background jobs moves the network traffic out of the user request path, freeing up the Rails app to respond immediately.

What's the best way to test external API integrations in Rails without real network calls?

The best way to test external API integrations without real network calls is using VCR cassette configuration. VCR records and replays API responses, eliminating live external calls in your test suites while ensuring accurate request and response validation.

How do I prevent credential leaks when logging external API traffic in Rails?

To prevent credential leaks when logging external API traffic, implement sanitized request and response logging. This strips sensitive authentication data from logs before they are written, securing your external API integration against credential exposure.

How do I stop retry storms from flaky upstream APIs in my Rails application?

Stop retry storms from flaky upstream APIs by implementing Stoplight-based circuit breaking. This circuit breaker monitors upstream failures and opens the circuit to halt requests, preventing compounding outages when an external API integration becomes unstable.

Do I need idempotency keys for POST requests to external APIs in Rails?

Yes, you need idempotency keys for POST requests to prevent duplicate records during automatic retries. Adding idempotency keys to your external API integration ensures that if a request is retried, the upstream API processes it only once.