Skip to main content

SDKs

SDKForPackageStatus
JavaScriptBrowsers and Node.js service applications@openrois/sdkAlpha
PythonAsyncio service applications and AI agentsopenrois-sdkAlpha
UnityDesktop, mobile and VR headset applicationsorg.openrois.sdkAlpha
Component SDK (Python)Components and adaptersopenrois-components-coreAlpha

The three client SDKs share one surface and one conformance list, which each passes against the same gateway and engine versions. They share the RoIS types of the generated types, so a message has the same fields in every language. See installation to add one to a project.

The Client Surface​

RoISClient has one method per operation of the RoIS method catalog. Each takes the operation's IDL parameters in IDL order and returns its out parameters. A result whose return code is not OK raises RoISError, which carries the return code.

RoIS interfaceJavaScriptPythonUnity
SystemRoISClient.connect(), disconnect(), getProfile(), getErrorDetail()RoISClient.connect(), disconnect(), get_profile(), get_error_detail()RoISClient.ConnectAsync(), DisconnectAsync(), GetProfileAsync(), GetErrorDetailAsync()
Commandsearch(), bind(), bindAny(), release(), getParameter(), setParameter(), execute(), getCommandResult()search(), bind(), bind_any(), release(), get_parameter(), set_parameter(), execute(), get_command_result()SearchAsync(), BindAsync(), BindAnyAsync(), ReleaseAsync(), GetParameterAsync(), SetParameterAsync(), ExecuteAsync(), GetCommandResultAsync()
Queryquery()query()QueryAsync()
Eventsubscribe(), unsubscribe(), getEventDetail()subscribe(), unsubscribe(), get_event_detail()SubscribeAsync(), UnsubscribeAsync(), GetEventDetailAsync()

Every client listens with on(name, listener) and off(name, listener), On and Off in Unity, for the four notifications of the catalog, and for close and error:

NameReceived
rois.event.notify_eventEvery event of every subscription
rois.command.completedThe status of a command that ended
rois.system.notify_errorAn error the engine reports
rois.system.profile_changedComponents that joined or left
closeThe close code and reason, from either side
errorA message that cannot be used, or a listener that failed

Conditions are strings in the OpenRoIS subset of CQL2-Text, and each SDK has builders for them: componentRef, componentType, like and allOf in JavaScript, with the same names in snake case in Python and in Pascal case on Condition in Unity.

RoIS has no operation that waits for a command, so no SDK has one either. Add the rois.command.completed listener before execute, record each status by command id, and wait for it before release, which aborts a running command. The service application guide shows this.

Per Language​

SDKNotesFull reference
JavaScriptOne ES module build. Uses the global WebSocket, or a webSocketFactory. await using disconnects at the end of a blockREADME
Pythonconnect() works with await and with async with. A plain listener runs in the reader, and a coroutine in a task of its ownREADME
UnityListeners run on the main thread. Clients end when Play Mode ends, also with domain reload off. Run in Linux players with IL2CPP and Mono, and in the Editor. The Android build has not run on a device, and iOS has not been builtREADME

None of the SDKs has been run over wss://, and the gateway does not authenticate connections in the alpha, so use it on trusted networks only.

Component SDK​

The Python packages that run next to a platform are separate from the client SDKs.

PackagePurpose
openrois-components-coreWrite components: @component(profile), @command, @query, @event, resources and status
openrois-engineThe recursive engine that hosts components in an adapter or a gateway
openrois-gatewayThe gateway process
openrois-interfacesRoIS types, the source of truth

See write components and adapters for a walkthrough.