Skip to main content

RA.Utilities.Integrations

NuGet version NuGet Downloads Codecov Publish NuGet GitHub license

The primary purpose of the RA.Utilities.Integrations package is to simplify and standardize how you make HTTP calls to external APIs in your .NET applications.

It builds on top of Microsoft's recommended IHttpClientFactory pattern to provide a structured, reusable, and resilient way to manage these integrations.

Here are the key problems it aims to solve:

  • Standardizes Configuration: It allows you to centralize all your HTTP client settings (like Base URL, timeouts, and API keys) in your appsettings.json file, keeping configuration separate from your code.
  • Simplifies Registration: It provides a single extension method, AddHttpClientIntegration, which handles all the boilerplate of registering a typed HttpClient, binding the configuration, and adding common policies like logging and retries.
  • Promotes Best Practices: It encourages using typed HttpClient, which gives you compile-time safety and better IntelliSense when making API calls.
  • Improves Resilience: It comes with built-in support for transient fault handling using a default Polly retry policy (with exponential backoff), making your application more robust against temporary network issues.

In short, this package provides a "batteries-included" solution for integrating with external services, saving you from writing repetitive setup code and ensuring all your API clients are configured consistently and correctly.

🛠️ Installation

You can install the package via the .NET CLI:

dotnet add package RA.Utilities.Integrations

Or through the NuGet Package Manager console:

Install-Package RA.Utilities.Integrations

🔗 Dependencies