Aspire.Hosting.Nats 13.5.0

NATS hosting integration

Use this integration to model, configure, and orchestrate a NATS resource in an Aspire solution.

Getting started

Add the integration

From your AppHost directory, add the Aspire.Hosting.Nats integration with the Aspire CLI:

aspire add Aspire.Hosting.Nats

Usage example

In the AppHost, add a NATS resource and reference it from another resource with either C# or TypeScript:

C#

var nats = builder.AddNats("nats");

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

TypeScript

const nats = await builder.addNats("nats");

const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
                       .withReference(nats);

Connection Properties

When you reference a NATS resource using WithReference, the following connection properties are made available to the consuming project:

NATS server

The NATS server resource exposes the following connection properties:

Property Name Description
Host The hostname or IP address of the NATS server
Port The port number the NATS server is listening on
Username The username for authentication
Password The password for authentication
Uri The connection URI with the format nats://{Username}:{Password}@{Host}:{Port}

Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called nats becomes NATS_URI.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

No packages depend on Aspire.Hosting.Nats.

Version Downloads Last updated
13.5.3 4 08/26/2026
13.5.2 9 08/22/2026
13.5.1 10 08/21/2026
13.5.0 7 08/19/2026
13.4.6 16 06/21/2026
13.4.5 15 06/21/2026
13.4.4 18 06/19/2026
13.4.3 15 06/10/2026
13.4.2 15 06/10/2026
13.4.1 16 06/10/2026
13.4.0 17 06/02/2026
13.3.5 17 05/23/2026
13.3.4 20 05/24/2026
13.3.3 21 05/17/2026
13.3.2 28 05/16/2026
13.3.1 16 05/17/2026
13.3.0 20 05/08/2026
13.2.4 26 04/27/2026
13.2.3 20 04/24/2026
13.2.2 24 04/09/2026
13.2.1 27 04/04/2026
13.2.0 26 03/28/2026
13.1.3 25 03/24/2026
13.1.2 33 02/27/2026
13.1.1 35 02/15/2026
13.1.0 41 12/18/2025
13.0.2 40 12/10/2025
13.0.1 37 12/12/2025
13.0.0 32 12/10/2025
9.5.2 35 12/10/2025
9.5.1 33 12/12/2025
9.5.0 33 12/09/2025
9.4.2 32 12/10/2025
9.4.1 34 12/10/2025
9.4.0 35 12/12/2025
9.3.1 45 12/17/2025
9.3.0 28 12/10/2025
9.2.1 32 12/19/2025
9.2.0 27 12/20/2025
9.1.0 39 12/14/2025
9.0.0 29 12/14/2025
9.0.0-rc.1.24511.1 28 12/10/2025
8.2.2 32 12/13/2025
8.2.1 36 12/20/2025
8.2.0 35 12/13/2025
8.1.0 35 12/12/2025
8.0.2 34 12/11/2025
8.0.1 34 12/20/2025
8.0.0 40 12/11/2025
8.0.0-preview.7.24251.11 31 12/20/2025
8.0.0-preview.6.24214.1 26 12/11/2025
8.0.0-preview.5.24201.12 27 12/20/2025