Our 0.4.0 SDK release marks the stable release of our 0.4.0 beta features. This includes Web and Native SDK ergonomic improvements designed to make using Rainway easier than ever.

While these features have been called out in previous beta changelogs, here’s a quick recap.

Web Ergonomics

We’ve made significant changes to the design of our Web SDK that aim to improve developer experience.

  • Event-based - We’ve moved away from global callbacks to per-object events.
  • Promisified - We now represent all async operations using Promise.
  • Composable - We’re commited to making @rainway/web a solid foundation to build on, with higher-level abstractions provided as additional packages.
import rainway, { InputLevel } from "@rainway/web";

// handle rainway component log events
rainway.addEventListener("log", (level, target, message) => {
    console.log(`[${level}] ${target} ${message}`);
});

// connect to Rainway services
const conn = await rainway.connect({apiKey: "YOUR_API_KEY" });

// obtain your id within the Rainway network
console.log(`Your peer id is ${conn.id}`);

// connect to another peer on the Rainway network using their id
const peer = await conn.connect(BigInt(12345678));

// create a stream between the peers, with permission to all input
const stream = await peer.createStream({ permissions: InputLevel.All });

// add the stream container to the DOM, it will automatically play
document.appendChild(stream.container);

//
// additional application logic here
//

// shut down the stream
await stream.close();

// shut down the peer connection
await peer.close();

// shut down the rainway connection
await conn.close();

For more information, see our updated documentation.

Native Ergonomics

We’ve made significant changes to the design of our Native SDKs that aim to improve developer experience.

  • Event-based - We’ve moved away from global callbacks to per-object events.
  • Async - We now represent all async operations using Promise in Node.js, and Task in .NET.
  • Documented - We’ve improved our object and method names, updated our in-editor documentation, and standardized terminology across our SDKs.

For samples using the new API, take a look at our example repositories:

We’ve also renamed our Node.js SDK to @rainway/native, to align with the naming of our other JS packages.

For more information about the API changes in this update, see our updated documentation.

Web Metrics

We’ve added support for capturing metrics during a stream, which captures transit throughput, negotiated codecs, and state transitions for the lifetime of the stream.

When requesting or accepting a stream, specify {metrics: true} alongside your other options, to enable metric collection. Once a stream has begun, call getReport() on it at any time to obtain the latest metric report.

We may request these reports from customers going forward to help us diagnose stream performance issues. We also wanted to make this data easily available for SDK consumers to analyze themselves.

Bugfixes and improvements

  • [Web SDK] Fixed cursor support in multi-peer streams.
  • [Native SDKs] Fixed support for multiple process IDs when using App Isolation.
  • [Node.js SDK] Fixed process ID marshalling issue that was leading to invalid App Isolation streams.
  • [Node.js SDK] Fixed an issue with receiving input. By default input will now be processed by the host.
  • [C/C++ SDK] Fixed an issue with Data Channel naming. Data Channels should now work properly.