openrtc-netcode-node 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,11 +4,11 @@ Node.js helpers for `openrtc-netcode`.
|
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
6
|
import { OpenRTC } from 'openrtc';
|
|
7
|
-
import { createNodeNetcode,
|
|
7
|
+
import { createNodeNetcode, nodeTransports } from 'openrtc-netcode-node';
|
|
8
8
|
|
|
9
9
|
const rtc = OpenRTC({
|
|
10
10
|
apiKey: process.env.OPENRTC_API_KEY!,
|
|
11
|
-
transports:
|
|
11
|
+
transports: nodeTransports('auto'),
|
|
12
12
|
});
|
|
13
13
|
const room = await rtc.rooms.join('match-123', {
|
|
14
14
|
access: 'capability',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type NetcodeClient, type NetcodeOptions } from 'openrtc-netcode';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Transports } from 'openrtc';
|
|
3
3
|
export type NodeTransportProfile = 'auto' | 'iroh' | 'webrtc' | 'moq' | 'all';
|
|
4
4
|
export type NodeNetcodeOptions = NetcodeOptions;
|
|
5
5
|
export declare function createNodeNetcode(options: NodeNetcodeOptions): NetcodeClient;
|
|
6
6
|
/** Use this when constructing OpenRTC; netcode itself never owns transport lifecycle. */
|
|
7
|
-
export declare function
|
|
8
|
-
export type { CreateLobbyOptions, JoinLobbyOptions, NetVar, NetVarOptions, NetcodeClient, NetcodeEventHandler, NetcodeEventName, NetcodeEvents, NetcodeLobby, NetcodeMessage,
|
|
7
|
+
export declare function nodeTransports(profile: NodeTransportProfile): Transports;
|
|
8
|
+
export type { CreateLobbyOptions, JoinLobbyOptions, NetVar, NetVarOptions, NetcodeClient, NetcodeEventHandler, NetcodeEventName, NetcodeEvents, NetcodeLobby, NetcodeMessage, MessageHandler, NetcodeOptions, NetcodePeer, NetcodeState, SendOptions, } from 'openrtc-netcode';
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export function createNodeNetcode(options) {
|
|
|
3
3
|
return createNetcode(options);
|
|
4
4
|
}
|
|
5
5
|
/** Use this when constructing OpenRTC; netcode itself never owns transport lifecycle. */
|
|
6
|
-
export function
|
|
6
|
+
export function nodeTransports(profile) {
|
|
7
7
|
const hasWebRtc = typeof globalThis.RTCPeerConnection === 'function';
|
|
8
8
|
const hasWebTransport = typeof globalThis.WebTransport === 'function';
|
|
9
9
|
switch (profile) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrtc-netcode-node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"test:watch": "vitest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"openrtc": "^2.
|
|
44
|
-
"openrtc-netcode": "^2.
|
|
43
|
+
"openrtc": "^2.1.0",
|
|
44
|
+
"openrtc-netcode": "^2.1.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^24.10.1",
|