com.droponair.sdk-unity
v0.1.2
Published
DropOnAir comms for Unity: E2EE messaging, attachments, broadcast, rooms, calls + moderation signaling, multi-device, push. Real-time voice/video media is an optional add-on (com.unity.webrtc for mesh, LiveKit for SFU), enabled when those packages are ins
Maintainers
Readme
DropOnAir SDK for Unity
End-to-end-encrypted comms for Unity (C#): 1:1 / group / cleartext messaging, attachments, broadcast channels, presence, rooms, calls + room signaling, moderation, multi-device, and push. Real-time voice/video is an optional media add-on.
Install (UPM)
Add via Package Manager (git URL) or Packages/manifest.json:
"com.droponair.sdk-unity": "<git-url>#<tag>"For local development you can point at a path; shipping builds should consume the published package.
Quick start
using DropOnAir;
var client = new DropOnAirClient(new DropOnAirConfig {
AppId = "YOUR_APP_ID",
PublicApiKey = "YOUR_PUBLIC_API_KEY",
// Your backend signs + proxies token exchange (server secret stays server-side):
TokenExchangeEndpoint = "https://your-backend.example.com/api/droponair/token",
KeyDirectoryEndpoint = "https://your-backend.example.com/api/droponair/keys",
});
client.MessageReceived += m => Debug.Log($"{m.FromUserId}: {m.Text}");
await client.ConnectAsync(userJwt); // userJwt from your auth system
await client.SendMessageAsync("user-123", "hi");API areas
Connection lifecycle, messaging (1:1 / group / cleartext) + read receipts, attachments (E2EE),
broadcast channels, calls (1:1 / group) + room signaling, rooms + SFU tokens, moderation + waiting
room, screen-share + recording signaling, multi-device, push. See Runtime/DropOnAirClient.cs.
Voice / video (optional)
Real-time media is an add-on. Install com.unity.webrtc (mesh) and/or LiveKit Unity (SFU), then
register an engine:
client.SetMediaEngine(new DropOnAir.Media.MeshMediaEngine()); // 1:1 + group mesh
string callId = await client.StartVoiceCallAsync("user-123"); // invite + start media
// or for a room over the SFU:
client.SetMediaEngine(new DropOnAir.Media.SfuMediaEngine());
await client.JoinRoomWithSfuAsync(roomId);Without an engine, the SDK still does all call signaling (CallSignalReceived) so you can drive your
own media. See Runtime/Media/README.md.
SFU (LiveKit) notes. The SFU engine targets LiveKit Unity v1.3.8
(https://github.com/livekit/client-sdk-unity.git#v1.3.8), which ships native binaries via Git LFS
(run git lfs install before importing) and bundles its own WebRTC. It is verified on Unity 6000.0.x.
On Unity 6000.4+, two unused screen-capture source files in that release reference a video-capture
module that Unity 6000.4 no longer auto-references; comment those two lines out, or stay on 6000.0.x,
until LiveKit publishes a 6000.4-compatible tag. The mesh engine (com.unity.webrtc) is bring-your-own:
that package is deprecated on Unity 6, so mesh is provided for customers who supply a working WebRTC
backend and is not shipped turnkey.
Dependencies (vendored, self-contained)
The package bundles its managed dependencies under Runtime/Plugins, so it works out of the box
with no NuGet/native setup:
Google.Protobuf.dll(3.34.1), the wire-format runtime forRuntime/Proto/Messaging.cs.BouncyCastle.Cryptography.dll(2.6.2), pure-managed E2EE primitives (X25519 + HKDF-SHA256 + AES-256-GCM), portable to every Unity target.
If your project already provides either library (e.g. via NuGetForUnity), delete the vendored copy to avoid a duplicate-assembly conflict.
Tests
Tests/ contains EditMode known-answer tests that validate the E2EE crypto is byte-compatible with
the other DropOnAir SDKs offline (no relay needed). Run them via Window > General > Test Runner.
Versioning
DropOnAirVersion.SdkVersion moves in lockstep with the other DropOnAir SDKs; ProtocolVersion
(6) and PayloadFormatVersion (1) must match the platform.
