Skip to main content

SDKs

SDKAudiencePackageStatus
TypeScriptWeb and Node.js service applications@openrois/sdkAvailable
C#Unity and .NET service applicationsorg.openrois.sdkAvailable
Python (adapter SDK)Components, adapters, and gatewaysopenrois-core, openrois-components-coreAvailable

All SDKs share the RoIS types generated by the type pipeline, so a message has the same fields in every language.

TypeScript​

RoISClient wraps the WebSocket transport and exposes the RoIS interfaces as asynchronous methods. Responses of the command, query, and event operations are validated at runtime against the generated schemas. The SDK ships ESM and CommonJS builds and runs in browsers and in Node.js.

RoIS interfaceMethods
SystemRoISClient.connect(), disconnect(), getProfile(), getErrorDetail()
Commandsearch(), bind(), bindAny(), release(), getParameter(), setParameter(), execute(), getCommandResult()
Queryquery()
Eventsubscribe(), unsubscribe(), getEventDetail()
StreamingconnectStream(), disconnectStream(), suspendStream(), resumeStream(), queryStreamStatus()

Pass { token } to RoISClient.connect() when the gateway authenticates; the SDK presents it at the WebSocket upgrade as the token query parameter.

Client eventEmitted for
<event_type>Each RoIS event, under its own type, for example reached_target
rois.event.notifyEvery RoIS event
rois.command.completedCommand completion
rois.system.notify_errorEngine errors
notificationEvery JSON-RPC notification, including rois.system.profile_changed
closeThe connection closed

Methods whose RoIS operation is not yet implemented by the engine (see the wire protocol) are already present in the SDK and fail until the engine supports them.

See write a service application for a walkthrough.

C#​

The C# SDK targets .NET Standard 2.1 for Unity 6.5 and later, works on any .NET runtime with System.Net.WebSockets, and is distributed as the Unity package org.openrois.sdk (Git URL install until it is listed on a registry).

RoISClient exposes the same operations as the TypeScript client as async methods, and raises EventReceived, CommandCompleted, ErrorNotified, ProfileChanged, and Closed as C# events. Callbacks are marshaled to the SynchronizationContext captured when ConnectAsync is called, which on Unity's main thread means they may touch scene objects directly. ClientOptions.Token presents a bearer token when the gateway authenticates.

var client = await RoISClient.ConnectAsync("ws://localhost:8765");
var nav = (await client.SearchAsync()).Find(r => r.Contains("Navigation"));
client.EventReceived += e => Debug.Log(e.EventType);
await client.SubscribeAsync(nav, "reached_target");
await client.BindAsync(nav);
var executed = await client.ExecuteAsync(nav);
RoIS interfaceMethods
SystemConnectAsync(), DisconnectAsync(), GetProfileAsync(), GetErrorDetailAsync()
CommandSearchAsync(), BindAsync(), BindAnyAsync(), ReleaseAsync(), GetParameterAsync(), SetParameterAsync(), ExecuteAsync(), GetCommandResultAsync()
QueryQueryAsync()
EventSubscribeAsync(), UnsubscribeAsync(), GetEventDetailAsync()
StreamingConnectStreamAsync(), DisconnectStreamAsync(), SuspendStreamAsync(), ResumeStreamAsync(), QueryStreamStatusAsync()

The client is verified outside the Unity editor by a plain .NET test project against an in-process fake gateway. WebGL builds need a browser transport, which is planned.

Python​

The Python packages are the building blocks for everything that runs next to a platform.

PackageMain APIPurpose
openrois-coreEngine, WsServer, WsClient, read_profile, component_configRun a gateway or an adapter
openrois-components-core@component, @query, @invoke, @subscribe, meta_from_decorators, resultsWrite components
openrois-interfacesResult, ReturnCode, InvokeResponse, typed component modelsRoIS types, the source of truth

See write components and adapters for a walkthrough.