DeviceChain.Sdk
0.18.0
dotnet add package DeviceChain.Sdk --version 0.18.0
NuGet\Install-Package DeviceChain.Sdk -Version 0.18.0
<PackageReference Include="DeviceChain.Sdk" Version="0.18.0" />
<PackageVersion Include="DeviceChain.Sdk" Version="0.18.0" />
<PackageReference Include="DeviceChain.Sdk" />
paket add DeviceChain.Sdk --version 0.18.0
#r "nuget: DeviceChain.Sdk, 0.18.0"
#:package DeviceChain.Sdk@0.18.0
#addin nuget:?package=DeviceChain.Sdk&version=0.18.0
#tool nuget:?package=DeviceChain.Sdk&version=0.18.0
DeviceChain .NET SDK
The public C# client SDK for DeviceChain, an open source IoT platform. It wraps the platform's documented wire seams so a .NET host — or a Unity digital twin — can authenticate, query, subscribe to live telemetry, and emit device-plane telemetry and commands.
The SDK is an untrusted external client. It speaks the same public surface any third-party application does, and never the platform's administrative one.
Install
dotnet add package DeviceChain.Sdk
Quick start
await using var client = new DeviceChainClient(new Uri("https://demo.devicechain.io"));
await client.LoginAsync("me@example.com", "…");
await client.SelectTenantAsync("acme");
// Query. The caller supplies its own source-generated JsonTypeInfo, which is what
// keeps the whole path AOT-safe:
var data = await client.Gql.SendAsync(
Area.DeviceManagement,
"query{devices(criteria:{pageNumber:1,pageSize:10}){results{token name}}}",
EmptyVariables.Value, MyJson.Default.EmptyVariables, MyJson.Default.DevicesData);
// Subscribe to live telemetry over graphql-transport-ws:
await foreach (var evt in client.Subscriptions(Area.EventManagement).SubscribeAsync(
"subscription{measurementStream{deviceToken name value unit}}",
EmptyVariables.Value, MyJson.Default.EmptyVariables, MyJson.Default.MeasurementStreamData, ct))
{
// …drive a chart, or a Unity twin transform
}
// Emit device-plane telemetry. The device-plane ingress is a SEPARATE listener from
// the GraphQL origin, so its origin is passed explicitly:
var publisher = client.DevicePublisher(
ingressOrigin: new Uri("https://ingress.demo.devicechain.io"),
instanceId: "dc", tenant: "acme");
await publisher.EmitMeasurementsAsync("car-42", credentialId,
new Dictionary<string, double> { ["speed"] = 55.0 });
What's in it
| Piece | Type |
|---|---|
| Auth state machine | Auth.AuthSession — login, tenant selection, and proactive near-expiry refresh |
| GraphQL over HTTP | GraphQlClient — typed query and mutation against a chosen functional area |
| Live subscriptions | Subscriptions.GraphQlWsClient — graphql-transport-ws, one multiplexed socket per area |
| Device-plane emit | Ingest.DeviceEventPublisher — measurements and locations over HTTP or MQTT |
| Transport seam | Transport.IHttpTransport / Transport.IWebSocketFactory — pluggable, so the SDK runs where HttpClient and ClientWebSocket do not (Unity WebGL) |
| Facade | DeviceChainClient — wires all of the above against one origin |
Targets and AOT
Multi-targets netstandard2.1 (the target Unity's IL2CPP consumes) and net8.0.
Serialization is source-generated (System.Text.Json [JsonSerializable]); there is
no Reflection.Emit and no runtime code generation anywhere in the library, and it
builds with IsAotCompatible and warnings-as-errors. That is what makes the same
assembly safe under IL2CPP and NativeAOT as under CoreCLR.
The MQTT dependency is pinned to the MQTTnet 4.x line on purpose: MQTTnet 5 dropped
netstandard2.1, which would silently remove the Unity half of this SDK.
Links
- Documentation — https://docs.devicechain.io
- Source and issues — https://github.com/devicechain-io/devicechain
Licensed under the Apache License 2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- MQTTnet (>= 4.3.7.1207)
- System.Text.Json (>= 8.0.5)
- System.Threading.Channels (>= 8.0.0)
-
net8.0
- MQTTnet (>= 4.3.7.1207)
- System.Text.Json (>= 8.0.5)
- System.Threading.Channels (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.18.0 | 64 | 9/28/2026 |
| 0.18.0-rc.1 | 52 | 9/28/2026 |
| 0.17.0 | 84 | 9/19/2026 |
| 0.17.0-rc.3 | 60 | 9/19/2026 |
| 0.17.0-rc.2 | 52 | 9/19/2026 |
| 0.16.0 | 92 | 9/10/2026 |
| 0.16.0-rc.1 | 59 | 9/10/2026 |
| 0.15.0 | 91 | 9/8/2026 |
| 0.15.0-rc.2 | 69 | 9/8/2026 |
| 0.15.0-rc.1 | 67 | 9/8/2026 |
| 0.14.0 | 95 | 9/2/2026 |
| 0.14.0-rc.1 | 65 | 9/2/2026 |