Skip to main content
net8.0net9.0net10.0

A KurrentDB client that integrates with Aspire, including health checks, logging, and telemetry.

Published
Mar 5, 2026
7mo ago
Total Downloads
14.0K
14,032

Install

dotnet add package CommunityToolkit.Aspire.KurrentDB --version 13.2.1-beta.528
ProductVersions
.NET
net10.0net8.0net9.0

README

CommunityToolkit.Aspire.KurrentDB

Registers an KurrentDBClient in the DI container for connecting to KurrentDB.

Getting started

Prerequisites

  • KurrentDB cluster.

Install the package

Install the Aspire KurrentDB Client library with NuGet:

dotnet add package CommunityToolkit.Aspire.KurrentDB

Usage example

In the Program.cs file of your project, call the AddKurrentDBClient extension method to register an KurrentDBClient for use via the dependency injection container. The method takes a connection name parameter.

builder.AddKurrentDBClient("kurrentdb");

Configuration

The Aspire KurrentDB Client integration provides multiple options to configure the server connection based on the requirements and conventions of your project.

Use a connection string

When using a connection string from the ConnectionStrings configuration section, you can provide the name of the connection string when calling builder.AddKurrentDBClient():

builder.AddKurrentDBClient("kurrentdb");

And then the connection string will be retrieved from the ConnectionStrings configuration section:

{
    "ConnectionStrings": {
        "kurrentdb": "kurrentdb://localhost:22113?tls=false"
    }
}

Use configuration providers

The Aspire KurrentDB Client integration supports Microsoft.Extensions.Configuration. It loads the KurrentDBSettings from configuration by using the Aspire:KurrentDB:Client key. Example appsettings.json that configures some of the options:

{
  "Aspire": {
    "KurrentDB": {
      "Client": {
        "ConnectionString": "kurrentdb://localhost:22113?tls=false",
        "DisableHealthChecks": true
      }
    }
  }
}

Use inline delegates

Also you can pass the Action<KurrentDBSettings> configureSettings delegate to set up some or all the options inline, for example to set the API key from code:

builder.AddKurrentDBClient("kurrentdb", settings => settings.DisableHealthChecks = true);

AppHost extensions

In your AppHost project, install the CommunityToolkit.Aspire.Hosting.KurrentDB library with NuGet:

dotnet add package CommunityToolkit.Aspire.Hosting.KurrentDB

Then, in the Program.cs file of AppHost, register KurrentDB and consume the connection using the following methods:

var kurrentdb = builder.AddKurrentDB("kurrentdb");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(kurrentdb);

The WithReference method configures a connection in the MyService project named kurrentdb. In the Program.cs file of MyService, the KurrentDB connection can be consumed using:

builder.AddKurrentDBClient("kurrentdb");

Then, in your service, inject KurrentDBClient and use it to interact with the KurrentDB API:

public class MyService(KurrentDBClient client)
{
    // ...
}

Additional documentation

Feedback & contributing

https://github.com/CommunityToolkit/Aspire

Changes from Previous Version

No structural changes between v13.1.2-beta.518 and v13.2.1-beta.528.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.The published metadata declares 14 direct dependency entries across framework groups. Inspect the resolved dependency graph for your target framework.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.