Agntcy.Slim
2.1.0
dotnet add package Agntcy.Slim --version 2.1.0
NuGet\Install-Package Agntcy.Slim -Version 2.1.0
<PackageReference Include="Agntcy.Slim" Version="2.1.0" />
<PackageVersion Include="Agntcy.Slim" Version="2.1.0" />
<PackageReference Include="Agntcy.Slim" />
paket add Agntcy.Slim --version 2.1.0
#r "nuget: Agntcy.Slim, 2.1.0"
#:package Agntcy.Slim@2.1.0
#addin nuget:?package=Agntcy.Slim&version=2.1.0
#tool nuget:?package=Agntcy.Slim&version=2.1.0
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:
- Start a SLIM server instance
- 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:
- Builds native libraries for all supported platforms
- Tests bindings locally with all platform libraries
- Creates a NuGet package with native libraries for all platforms
- Publishes to NuGet.org
License
Apache-2.0 - See LICENSE for details.
Related Projects
- Go bindings - Go bindings for SLIM
- Python bindings - Python bindings for SLIM
- uniffi-bindgen-cs - C# bindings generator for UniFFI
| Product | Versions 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. |
-
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 |