Agntcy.Slim 2.1.0

dotnet add package Agntcy.Slim --version 2.1.0
                    
NuGet\Install-Package Agntcy.Slim -Version 2.1.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="Agntcy.Slim" Version="2.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Agntcy.Slim" Version="2.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Agntcy.Slim" />
                    
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 Agntcy.Slim --version 2.1.0
                    
#r "nuget: Agntcy.Slim, 2.1.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 Agntcy.Slim@2.1.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=Agntcy.Slim&version=2.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Agntcy.Slim&version=2.1.0
                    
Install as a Cake Tool

SLIM C# SDK

C# SDK for SLIM (Secure Low-Latency Interactive Messaging).

This SDK provides an idiomatic C# API built on top of auto-generated bindings from uniffi-bindgen-cs.

Requirements

  • .NET 8.0 or higher
  • Rust toolchain (for building native libraries from source)
  • Task (optional, for build automation)

Quick Start

Using NuGet Package

dotnet add package Agntcy.Slim

The NuGet package includes native libraries for all supported platforms. No additional setup required!

using Agntcy.Slim;

Slim.Initialize();
var service = Slim.GetGlobalService();
// ...
Slim.Shutdown();

Building from Source

To build the complete SDK, you need artifacts from the Rust bindings build:

# From the root of the repository
cd dotnet
task ci BINDGEN_TARGET=x86_64-unknown-linux-gnu PROFILE=release

For development on a single platform:

task generate
task build
task test

API Overview

Main Classes

Class Description
Slim Static entry point for initialization, shutdown, and global access
SlimService Service for managing connections and creating apps
SlimApp Application for managing sessions, subscriptions, and routing
SlimSession Session for sending and receiving messages
SlimName Identity in org/namespace/app format
SlimMessage Received message with Payload (bytes) and Text (string)
SlimSessionConfig Session configuration (type, MLS, retries)

Examples

The SDK includes complete working examples demonstrating real-world usage:

  • Point-to-Point (Slim.Examples.PointToPoint): 1:1 messaging with request/reply pattern
  • Group Messaging (Slim.Examples.Group): Group sessions with moderator/participant roles
  • slimrpc (Slim.Examples.SlimRpc): Protobuf RPC over SLIM (see SLIMRPC.md)

Quick Start:

# Run receiver
dotnet run --project Slim.Examples.PointToPoint -- --local org/alice/v1

# Run sender (in another terminal)
dotnet run --project Slim.Examples.PointToPoint -- \
  --local org/bob/v1 --remote org/alice/v1 --message "Hello"

slimrpc Example:

Requires a running SLIM server. See the SLIM repository for instructions on running a server (for example, from the slim repo: cd data-plane && cargo run --bin slim -- --config ./config/base/server-config.yaml).

# Generate proto code (requires buf and protoc-gen-slimrpc-csharp)
task slimrpc:generate-proto

# Run server (in one terminal)
dotnet run --project Slim.Examples.SlimRpc -- --mode server

# Run client (in another terminal)
dotnet run --project Slim.Examples.SlimRpc -- --mode client

See example source code in Slim.Examples.* projects for full implementation details and command-line options.

Running Tests

The SDK includes smoke tests that don't require a running SLIM server:

task test

For full integration testing with a SLIM server, you would need to:

  1. Start a SLIM server instance
  2. Run the example applications to verify functionality

See the Slim.Examples.* projects for working integration examples.

Development

Available Tasks

task                  # List all available tasks
task ci               # Run complete CI pipeline: generate, copy runtimes, build, test, pack
task format           # Format the C# code using dotnet format
task lint             # Check code formatting without applying changes
task generate         # Generate C# bindings from artifacts (requires ARTIFACTS_DIR)
task copy:runtimes    # Copy runtime libraries from artifacts to runtimes directory
task build            # Build .NET solution (expects bindings already generated)
task test             # Run smoke tests (no server required)
task pack             # Create NuGet package (expects runtimes already copied)
task clean            # Clean all build artifacts

Regenerating Bindings

If the Rust bindings change, you need to rebuild the Rust library first, then regenerate C# bindings:

task generate

Platform Support

Platform Architecture .NET RID Status
Linux (GNU) x86_64 linux-x64 Supported
Linux (GNU) aarch64 linux-arm64 Supported
Linux (musl) x86_64 linux-musl-x64 Supported
Linux (musl) aarch64 linux-musl-arm64 Supported
macOS x86_64 osx-x64 Supported
macOS aarch64 osx-arm64 Supported
Windows x86_64 win-x64 Supported
Windows aarch64 win-arm64 Supported

NuGet Package

The NuGet package includes native libraries for all supported platforms using the standard runtimes/{rid}/native/ structure. When you install the package, .NET automatically selects the correct native library for your platform.

# Install the package
dotnet add package Agntcy.Slim

# Build and run - native library is automatically included
dotnet run

Publishing to NuGet

The NuGet package is automatically published when a release tag is pushed (e.g., slim-bindings-v0.1.0). The release workflow:

  1. Builds native libraries for all supported platforms
  2. Tests bindings locally with all platform libraries
  3. Creates a NuGet package with native libraries for all platforms
  4. Publishes to NuGet.org

License

Apache-2.0 - See LICENSE for details.

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 was computed.  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 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Agntcy.Slim:

Package Downloads
Agntcy.Slim.SlimRpc

C# slimrpc helper library for SLIM bindings

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.0 90 8/13/2026
2.0.0 129 8/5/2026
2.0.0-alpha.7 66 8/3/2026
2.0.0-alpha.5 68 7/31/2026
2.0.0-alpha.4 58 7/21/2026
2.0.0-alpha.3 65 7/15/2026
2.0.0-alpha.2 70 6/29/2026
2.0.0-alpha.1 68 6/23/2026
2.0.0-alpha.0 65 6/3/2026
1.4.1 129 5/23/2026
1.4.0 127 5/13/2026
1.4.0-rc.6 69 5/13/2026
1.4.0-rc.5 69 5/12/2026
1.4.0-rc.3 68 5/12/2026
1.4.0-rc.2 74 5/11/2026
1.4.0-rc.1 77 5/8/2026
1.4.0-rc.0 66 4/21/2026
1.3.0 1,433 3/31/2026
1.3.0-rc.3 74 3/31/2026
1.3.0-rc.1 69 3/26/2026
Loading failed