IdempotencyGuard 1.3.0

dotnet add package IdempotencyGuard --version 1.3.0
                    
NuGet\Install-Package IdempotencyGuard -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IdempotencyGuard" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IdempotencyGuard" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="IdempotencyGuard" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IdempotencyGuard --version 1.3.0
                    
#r "nuget: IdempotencyGuard, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IdempotencyGuard@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IdempotencyGuard&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=IdempotencyGuard&version=1.3.0
                    
Install as a Cake Tool

IdempotencyGuard

Core abstractions and in-memory store for the IdempotencyGuard library. This package provides the foundational types, interfaces, and an in-memory store implementation for idempotent HTTP API request handling.

What's in this package

  • IIdempotencyStore — store interface for claim/response lifecycle
  • IPurgableIdempotencyStore — extension interface for stores that support expired entry cleanup
  • IDownstreamKeyGenerator / IIdempotencyContext — deterministic key generation for downstream service calls
  • InMemoryIdempotencyStore — in-memory store for development and testing
  • RequestFingerprint — SHA256-based request fingerprinting with JSON normalisation
  • IdempotencyOptions — full configuration model
  • Built-in metrics via System.Diagnostics.Metrics under the IdempotencyGuard meter

When to use this package directly

Most applications should install IdempotencyGuard.AspNetCore instead, which includes this package as a dependency and adds the ASP.NET Core middleware.

Install this package directly if you are:

  • Building a custom store implementation
  • Using the fingerprinting or key generation utilities outside of ASP.NET Core
  • Writing a non-ASP.NET Core host that needs the core abstractions

Installation

dotnet add package IdempotencyGuard

Implementing a custom store

public class MyCustomStore : IIdempotencyStore
{
    public Task<ClaimResult> TryClaimAsync(string key, string fingerprint, TimeSpan claimTtl, CancellationToken ct = default)
    {
        // Atomically claim the key or return the existing state
    }

    public Task SetResponseAsync(string key, IdempotentResponse response, TimeSpan responseTtl, CancellationToken ct = default)
    {
        // Store the response for replay
    }

    public Task<IdempotentResponse?> GetResponseAsync(string key, CancellationToken ct = default)
    {
        // Retrieve a cached response
    }

    public Task ReleaseClaimAsync(string key, CancellationToken ct = default)
    {
        // Release a claim after processing failure
    }
}

Available store packages

Store Package
Redis IdempotencyGuard.Redis
PostgreSQL IdempotencyGuard.PostgreSql
SQL Server IdempotencyGuard.SqlServer

Documentation

See the full documentation on GitHub for configuration, usage guides, and examples.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on IdempotencyGuard:

Package Downloads
IdempotencyGuard.Redis

Redis-backed idempotency store with atomic Lua scripts for IdempotencyGuard. Provides distributed claim coordination and response caching via StackExchange.Redis.

IdempotencyGuard.AspNetCore

ASP.NET Core middleware for automatic idempotent request handling. Provides Idempotency-Key header processing, request fingerprinting, response caching and replay, and per-endpoint configuration via attributes.

IdempotencyGuard.PostgreSql

PostgreSQL-backed idempotency store using INSERT ON CONFLICT for IdempotencyGuard. Provides durable claim coordination and response caching with automatic schema provisioning.

IdempotencyGuard.SqlServer

SQL Server-backed idempotency store using MERGE for IdempotencyGuard. Provides durable claim coordination and response caching with automatic schema provisioning.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 222 4/26/2026
1.2.4 181 4/3/2026
1.2.3 233 3/18/2026
1.2.2 171 3/10/2026
1.2.1 172 3/10/2026
1.2.0 173 3/10/2026
1.1.0 171 3/10/2026
1.0.0 179 3/7/2026