@volorio/sdk 0.2.0 → 0.2.1
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/LICENSE +16 -0
- package/README.md +31 -145
- package/package.json +19 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Volorio SDK Commercial License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Volorio. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission to install and use this SDK is granted only to an authorized Volorio
|
|
6
|
+
customer or evaluator, solely to integrate an application with Volorio services,
|
|
7
|
+
and subject to the Volorio Terms at https://volor.io/terms.
|
|
8
|
+
|
|
9
|
+
Except where the Volorio Terms expressly allow it, you may not redistribute,
|
|
10
|
+
sublicense, sell, publish, reverse engineer, or create a competing service from
|
|
11
|
+
this SDK or its source code. No ownership rights are transferred.
|
|
12
|
+
|
|
13
|
+
Third-party dependencies remain subject to their respective licenses.
|
|
14
|
+
|
|
15
|
+
THE SDK IS PROVIDED WITHOUT WARRANTIES EXCEPT TO THE EXTENT EXPRESSLY STATED IN
|
|
16
|
+
THE VOLORIO TERMS.
|
package/README.md
CHANGED
|
@@ -1,173 +1,59 @@
|
|
|
1
1
|
# @volorio/sdk
|
|
2
2
|
|
|
3
|
-
Volorio
|
|
3
|
+
Volorio RTC, chat, usage, billing, and media services SDK for Node.js and browsers.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @volorio/sdk
|
|
8
|
+
npm install @volorio/sdk@0.2.1
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Runtime and security
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- Runtime: Split server and client entry points
|
|
14
|
+
- Source version: `0.2.1`
|
|
15
|
+
- Registry status: published as 0.2.1
|
|
16
|
+
- API base URL for server calls: `https://api.volor.io`
|
|
17
|
+
- License: proprietary commercial SDK; see the included `LICENSE` and [Volorio Terms](https://volor.io/terms).
|
|
18
|
+
- Never expose a Volorio API key in browser, React Native, or Flutter code. Create short-lived sessions in your backend.
|
|
19
|
+
- Capability note: Requested products must be granted to the API key and accepted by the session endpoint.
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
import express from "express";
|
|
17
|
-
import { VolorioServerClient } from "@volorio/sdk/node";
|
|
18
|
-
|
|
19
|
-
const app = express();
|
|
20
|
-
app.use(express.json());
|
|
21
|
-
|
|
22
|
-
const volorio = new VolorioServerClient({
|
|
23
|
-
apiBaseUrl: "https://api.volorio.com",
|
|
24
|
-
apiKey: process.env.VOLORIO_API_KEY!,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
app.post("/api/volorio/session", async (request, response) => {
|
|
28
|
-
const session = await volorio.createRoomSession({
|
|
29
|
-
projectId: request.body.projectId,
|
|
30
|
-
roomId: request.body.roomId,
|
|
31
|
-
identity: request.body.identity,
|
|
32
|
-
quality: request.body.quality ?? "hd",
|
|
33
|
-
products: ["rtc_voice", "rtc_video_hd", "ai_noise_suppression", "spatial_audio_3d", "interactive_whiteboard"],
|
|
34
|
-
ttlSeconds: 3600,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
response.json(session);
|
|
38
|
-
});
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Browser usage
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import { VolorioRoomClient } from "@volorio/sdk/browser";
|
|
45
|
-
|
|
46
|
-
const session = await fetch("/api/volorio/session", {
|
|
47
|
-
method: "POST",
|
|
48
|
-
headers: { "content-type": "application/json" },
|
|
49
|
-
body: JSON.stringify({
|
|
50
|
-
projectId: "proj_123",
|
|
51
|
-
roomId: "sales-demo",
|
|
52
|
-
identity: "visitor_42",
|
|
53
|
-
quality: "fullhd",
|
|
54
|
-
}),
|
|
55
|
-
}).then((response) => response.json());
|
|
56
|
-
|
|
57
|
-
const room = new VolorioRoomClient({
|
|
58
|
-
participantMinutePriceMicros: 590,
|
|
59
|
-
videoMinutePriceMicros: 890,
|
|
60
|
-
screenShareMinutePriceMicros: 120,
|
|
61
|
-
chatMinutePriceMicros: 80,
|
|
62
|
-
noiseSuppressionMinutePriceMicros: 590,
|
|
63
|
-
spatialAudioMinutePriceMicros: 990,
|
|
64
|
-
whiteboardMinutePriceMicros: 1_400,
|
|
65
|
-
classroomMinutePriceMicros: 2_190,
|
|
66
|
-
noiseSuppressionProcessorFactory: async () => createYourAudioNoiseSuppressionProcessor(),
|
|
67
|
-
spatialAudioEngineFactory: async () => createYourSpatialAudioEngine(),
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
room.on("usageEstimateChanged", (estimate) => {
|
|
71
|
-
console.log("live participant minutes", estimate.participantMinutes);
|
|
72
|
-
console.log("estimated amount micros", estimate.estimatedAmountMicros);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
await room.join(session);
|
|
76
|
-
await room.enableCamera(true);
|
|
77
|
-
await room.enableMicrophone(true);
|
|
78
|
-
await room.enableNoiseSuppression(true);
|
|
79
|
-
await room.enableSpatialAudio(true);
|
|
80
|
-
await room.setSpatialAudioParticipantPosition("visitor_42", { x: 0, y: 0, z: -1 });
|
|
81
|
-
await room.setSpatialAudioListenerPosition({ x: 0, y: 0, z: 0 });
|
|
82
|
-
await room.enableWhiteboard(true);
|
|
83
|
-
await room.enableFlexibleClassroom({
|
|
84
|
-
classroomId: "math_101",
|
|
85
|
-
role: "teacher",
|
|
86
|
-
layout: "lecture",
|
|
87
|
-
enableWhiteboard: true,
|
|
88
|
-
enableScreenShare: true,
|
|
89
|
-
});
|
|
90
|
-
await room.sendWhiteboardStroke({
|
|
91
|
-
strokeId: "stroke_001",
|
|
92
|
-
color: "#111111",
|
|
93
|
-
width: 4,
|
|
94
|
-
points: [{ x: 0, y: 0 }, { x: 10, y: 8 }],
|
|
95
|
-
});
|
|
96
|
-
await room.sendMessage("hello");
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
`enableNoiseSuppression(true)` requires the backend session to include the `ai_noise_suppression` product grant and requires a browser audio processor factory. If no processor is configured, the SDK fails loudly instead of pretending the product is active.
|
|
100
|
-
`enableSpatialAudio(true)` requires the backend session to include the `spatial_audio_3d` product grant and requires a browser spatial audio engine factory.
|
|
101
|
-
`enableWhiteboard(true)` requires the backend session to include the `interactive_whiteboard` product grant. Stroke and clear events are sent over Volorio reliable room data messages.
|
|
102
|
-
`enableFlexibleClassroom(...)` requires the backend session to include the `flexible_classroom` product grant. The server helper below also requests whiteboard and screen-share grants by default.
|
|
21
|
+
## Public API
|
|
103
22
|
|
|
104
|
-
|
|
23
|
+
- `VolorioServerClient`
|
|
24
|
+
- `VolorioRoomClient`
|
|
25
|
+
- `createVolorioSessionProducts`
|
|
26
|
+
- `volorioPricingCatalog`
|
|
105
27
|
|
|
106
28
|
```ts
|
|
107
|
-
|
|
108
|
-
projectId: "proj_123",
|
|
109
|
-
classroomId: "math_101",
|
|
110
|
-
roomId: "classroom_math_101",
|
|
111
|
-
identity: "teacher_001",
|
|
112
|
-
role: "teacher",
|
|
113
|
-
layout: "lecture",
|
|
114
|
-
quality: "fullhd",
|
|
115
|
-
});
|
|
29
|
+
import { VolorioRoomClient } from "@volorio/sdk";
|
|
116
30
|
```
|
|
117
31
|
|
|
118
|
-
|
|
32
|
+
## Quick start
|
|
119
33
|
|
|
120
|
-
|
|
34
|
+
Backend:
|
|
121
35
|
|
|
122
36
|
```ts
|
|
123
|
-
|
|
124
|
-
projectId: "proj_123",
|
|
125
|
-
periodStart: "2026-08-01T00:00:00.000Z",
|
|
126
|
-
periodEnd: "2026-09-01T00:00:00.000Z",
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
console.log(analytics.totalQuantity, analytics.totalAmountMicros, analytics.products);
|
|
37
|
+
import { VolorioServerClient } from "@volorio/sdk/node";
|
|
130
38
|
```
|
|
131
39
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
## Product catalog
|
|
40
|
+
Browser:
|
|
135
41
|
|
|
136
42
|
```ts
|
|
137
|
-
import {
|
|
43
|
+
import { VolorioRoomClient } from "@volorio/sdk/browser";
|
|
138
44
|
|
|
139
|
-
|
|
45
|
+
const room = new VolorioRoomClient();
|
|
46
|
+
await room.join(sessionFromYourBackend);
|
|
140
47
|
```
|
|
141
48
|
|
|
142
|
-
|
|
49
|
+
## Dependencies
|
|
143
50
|
|
|
144
|
-
|
|
51
|
+
- `@volorio/core` `^0.2.0`
|
|
52
|
+
- `@volorio/rtc` `^0.2.0`
|
|
53
|
+
- `@volorio/server` `^0.2.0`
|
|
145
54
|
|
|
146
|
-
|
|
147
|
-
import { VolorioServerClient } from "@volorio/sdk/node";
|
|
55
|
+
## Documentation
|
|
148
56
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
await volorio.startMediaPush({
|
|
155
|
-
roomId: "room_123",
|
|
156
|
-
outputUrl: "rtmp://cdn.example.com/live/stream",
|
|
157
|
-
quality: "fullhd",
|
|
158
|
-
layout: "speaker",
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
await volorio.startMediaPull({
|
|
162
|
-
roomId: "room_123",
|
|
163
|
-
sourceUrl: "https://cdn.example.com/live/source.m3u8",
|
|
164
|
-
participantIdentity: "remote_stage",
|
|
165
|
-
});
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Local package build
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
pnpm --filter @volorio/sdk build
|
|
172
|
-
pnpm --filter @volorio/sdk pack:local
|
|
173
|
-
```
|
|
57
|
+
- [Volorio npm integration guide](https://volor.io/docs/packages/npm-overview)
|
|
58
|
+
- [REST and SDK documentation](https://volor.io/docs)
|
|
59
|
+
- [Volorio Console](https://app.volor.io)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volorio/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Volorio RTC, chat, usage, billing, and media services SDK for Node.js and browsers.",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"dist/src",
|
|
28
|
-
"README.md"
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
29
30
|
],
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public",
|
|
@@ -40,5 +41,20 @@
|
|
|
40
41
|
"@volorio/core": "^0.2.0",
|
|
41
42
|
"@volorio/rtc": "^0.2.0",
|
|
42
43
|
"@volorio/server": "^0.2.0"
|
|
43
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://volor.io/docs/packages/npm-overview",
|
|
46
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
47
|
+
"keywords": [
|
|
48
|
+
"volorio",
|
|
49
|
+
"realtime",
|
|
50
|
+
"rtc",
|
|
51
|
+
"sdk",
|
|
52
|
+
"chat",
|
|
53
|
+
"usage",
|
|
54
|
+
"billing",
|
|
55
|
+
"media",
|
|
56
|
+
"services",
|
|
57
|
+
"node",
|
|
58
|
+
"browsers"
|
|
59
|
+
]
|
|
44
60
|
}
|