@volorio/sdk 0.1.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 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,89 +1,59 @@
1
1
  # @volorio/sdk
2
2
 
3
- Volorio SDK lets customers sell and embed RTC video, voice, live streaming, chat, screen share, and usage metering in their own websites.
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 livekit-client
8
+ npm install @volorio/sdk@0.2.1
9
9
  ```
10
10
 
11
- ## Server-side token endpoint
11
+ ## Runtime and security
12
12
 
13
- Never expose a Volorio API key in browser code. Put it in your backend and return short-lived room sessions to your website.
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
- ```ts
16
- import express from "express";
17
- import { VolorioServerClient } from "@volorio/sdk/node";
21
+ ## Public API
22
+
23
+ - `VolorioServerClient`
24
+ - `VolorioRoomClient`
25
+ - `createVolorioSessionProducts`
26
+ - `volorioPricingCatalog`
18
27
 
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
- ttlSeconds: 3600,
34
- });
35
-
36
- response.json(session);
37
- });
28
+ ```ts
29
+ import { VolorioRoomClient } from "@volorio/sdk";
38
30
  ```
39
31
 
40
- ## Browser usage
32
+ ## Quick start
41
33
 
42
- ```ts
43
- import { VolorioRoomClient } from "@volorio/sdk/browser";
34
+ Backend:
44
35
 
45
- const session = await fetch("/api/volorio/session", {
46
- method: "POST",
47
- headers: { "content-type": "application/json" },
48
- body: JSON.stringify({
49
- projectId: "proj_123",
50
- roomId: "sales-demo",
51
- identity: "visitor_42",
52
- quality: "fullhd",
53
- }),
54
- }).then((response) => response.json());
55
-
56
- const room = new VolorioRoomClient({
57
- participantMinutePriceMicros: 590,
58
- videoMinutePriceMicros: 890,
59
- screenShareMinutePriceMicros: 120,
60
- chatMinutePriceMicros: 80,
61
- });
62
-
63
- room.on("usageEstimateChanged", (estimate) => {
64
- console.log("live participant minutes", estimate.participantMinutes);
65
- console.log("estimated amount micros", estimate.estimatedAmountMicros);
66
- });
67
-
68
- await room.join(session);
69
- await room.enableCamera(true);
70
- await room.enableMicrophone(true);
71
- await room.sendMessage("hello");
36
+ ```ts
37
+ import { VolorioServerClient } from "@volorio/sdk/node";
72
38
  ```
73
39
 
74
- ## Product catalog
40
+ Browser:
75
41
 
76
42
  ```ts
77
- import { volorioPricingCatalog } from "@volorio/sdk/pricing";
43
+ import { VolorioRoomClient } from "@volorio/sdk/browser";
78
44
 
79
- console.table(volorioPricingCatalog);
45
+ const room = new VolorioRoomClient();
46
+ await room.join(sessionFromYourBackend);
80
47
  ```
81
48
 
82
- Current catalog includes separate products for conversational AI, RTC voice, RTC video HD, RTC video FullHD, RTC video 2K, RTC video 4K, live streaming, signaling, chat MAU, speech-to-text, translation, recording, media gateway, transcoding, media push, media pull, AI noise suppression, 3D spatial audio, whiteboard, analytics, and flexible classroom.
49
+ ## Dependencies
83
50
 
84
- ## Local package build
51
+ - `@volorio/core` `^0.2.0`
52
+ - `@volorio/rtc` `^0.2.0`
53
+ - `@volorio/server` `^0.2.0`
85
54
 
86
- ```bash
87
- pnpm --filter @volorio/sdk build
88
- pnpm --filter @volorio/sdk pack:local
89
- ```
55
+ ## Documentation
56
+
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)
@@ -1,53 +1 @@
1
- type EventName = "participantsChanged" | "messageReceived" | "usageEstimateChanged" | "connected" | "disconnected";
2
- type Handler = (event: unknown) => void;
3
- export interface VolorioBrowserSession {
4
- livekitUrl: string;
5
- token: string;
6
- identity: string;
7
- }
8
- export interface VolorioUsageEstimate {
9
- participantMinutes: number;
10
- estimatedAmountMicros: number;
11
- }
12
- export interface VolorioRoomClientOptions {
13
- roomFactory?: () => VolorioRoomLike;
14
- now?: () => number;
15
- participantMinutePriceMicros?: number;
16
- videoMinutePriceMicros?: number;
17
- screenShareMinutePriceMicros?: number;
18
- chatMinutePriceMicros?: number;
19
- }
20
- export interface VolorioRoomLike {
21
- localParticipant: {
22
- setCameraEnabled(enabled: boolean): Promise<void>;
23
- setMicrophoneEnabled(enabled: boolean): Promise<void>;
24
- setScreenShareEnabled(enabled: boolean): Promise<void>;
25
- publishData(payload: Uint8Array, options?: {
26
- reliable?: boolean;
27
- }): Promise<void>;
28
- };
29
- on(event: string, handler: (...args: unknown[]) => void): void;
30
- connect(url: string, token: string): Promise<void>;
31
- disconnect(): void;
32
- }
33
- export declare class VolorioRoomClient {
34
- private readonly handlers;
35
- private readonly roomFactory;
36
- private readonly now;
37
- private readonly rates;
38
- private room;
39
- private joinedAt;
40
- private featureState;
41
- constructor(options?: VolorioRoomClientOptions);
42
- on(event: EventName, handler: Handler): () => void;
43
- join(session: VolorioBrowserSession): Promise<void>;
44
- disconnect(): void;
45
- enableCamera(enabled: boolean): Promise<void>;
46
- enableMicrophone(enabled: boolean): Promise<void>;
47
- enableScreenShare(enabled: boolean): Promise<void>;
48
- sendMessage(message: string): Promise<void>;
49
- updateUsageEstimate(): VolorioUsageEstimate;
50
- private requireRoom;
51
- private emit;
52
- }
53
- export {};
1
+ export * from "@volorio/rtc";
@@ -1,97 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VolorioRoomClient = void 0;
4
- class VolorioRoomClient {
5
- handlers = new Map();
6
- roomFactory;
7
- now;
8
- rates;
9
- room;
10
- joinedAt = 0;
11
- featureState = { camera: false, screenShare: false, chat: false };
12
- constructor(options = {}) {
13
- this.roomFactory = options.roomFactory ?? createLiveKitRoom;
14
- this.now = options.now ?? Date.now;
15
- this.rates = {
16
- participantMinutePriceMicros: options.participantMinutePriceMicros ?? 590,
17
- videoMinutePriceMicros: options.videoMinutePriceMicros ?? 250,
18
- screenShareMinutePriceMicros: options.screenShareMinutePriceMicros ?? 120,
19
- chatMinutePriceMicros: options.chatMinutePriceMicros ?? 80,
20
- };
21
- }
22
- on(event, handler) {
23
- const handlers = this.handlers.get(event) ?? [];
24
- handlers.push(handler);
25
- this.handlers.set(event, handlers);
26
- return () => this.handlers.set(event, handlers.filter((item) => item !== handler));
27
- }
28
- async join(session) {
29
- this.room = this.roomFactory();
30
- this.room.on("disconnected", () => this.emit("disconnected", undefined));
31
- this.room.on("participantConnected", () => this.emit("participantsChanged", undefined));
32
- this.room.on("participantDisconnected", () => this.emit("participantsChanged", undefined));
33
- this.room.on("dataReceived", (payload, participant) => {
34
- this.emit("messageReceived", { payload, participant });
35
- });
36
- await this.room.connect(session.livekitUrl, session.token);
37
- this.joinedAt = this.now();
38
- this.emit("connected", { identity: session.identity });
39
- this.updateUsageEstimate();
40
- }
41
- disconnect() {
42
- this.room?.disconnect();
43
- this.room = undefined;
44
- this.emit("disconnected", undefined);
45
- }
46
- async enableCamera(enabled) {
47
- await this.requireRoom().localParticipant.setCameraEnabled(enabled);
48
- this.featureState.camera = enabled;
49
- this.updateUsageEstimate();
50
- }
51
- async enableMicrophone(enabled) {
52
- await this.requireRoom().localParticipant.setMicrophoneEnabled(enabled);
53
- }
54
- async enableScreenShare(enabled) {
55
- await this.requireRoom().localParticipant.setScreenShareEnabled(enabled);
56
- this.featureState.screenShare = enabled;
57
- this.updateUsageEstimate();
58
- }
59
- async sendMessage(message) {
60
- await this.requireRoom().localParticipant.publishData(new TextEncoder().encode(message), { reliable: true });
61
- this.featureState.chat = true;
62
- this.updateUsageEstimate();
63
- }
64
- updateUsageEstimate() {
65
- const elapsedMinutes = Math.max(0, (this.now() - this.joinedAt) / 60000);
66
- const perMinute = this.rates.participantMinutePriceMicros +
67
- (this.featureState.camera ? this.rates.videoMinutePriceMicros : 0) +
68
- (this.featureState.screenShare ? this.rates.screenShareMinutePriceMicros : 0) +
69
- (this.featureState.chat ? this.rates.chatMinutePriceMicros : 0);
70
- const estimate = {
71
- participantMinutes: elapsedMinutes,
72
- estimatedAmountMicros: Math.round(elapsedMinutes * perMinute),
73
- };
74
- this.emit("usageEstimateChanged", estimate);
75
- return estimate;
76
- }
77
- requireRoom() {
78
- if (this.room === undefined) {
79
- throw new Error("Volorio room is not connected");
80
- }
81
- return this.room;
82
- }
83
- emit(event, payload) {
84
- for (const handler of this.handlers.get(event) ?? []) {
85
- handler(payload);
86
- }
87
- }
88
- }
89
- exports.VolorioRoomClient = VolorioRoomClient;
90
- function createLiveKitRoom() {
91
- const livekit = globalThis.LivekitClient;
92
- if (livekit === undefined) {
93
- throw new Error("livekit-client is required. Pass roomFactory or load LivekitClient in the browser.");
94
- }
95
- return new livekit.Room();
96
- }
17
+ __exportStar(require("@volorio/rtc"), exports);
97
18
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;AAmCA,MAAa,iBAAiB;IACX,QAAQ,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC3C,WAAW,CAAwB;IACnC,GAAG,CAAe;IAClB,KAAK,CAAiK;IAC/K,IAAI,CAA8B;IAClC,QAAQ,GAAG,CAAC,CAAC;IACb,YAAY,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAE1E,YAAY,UAAoC,EAAE;QAChD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,iBAAiB,CAAC;QAC5D,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG;YACX,4BAA4B,EAAE,OAAO,CAAC,4BAA4B,IAAI,GAAG;YACzE,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,IAAI,GAAG;YAC7D,4BAA4B,EAAE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QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;YACrD,OAAO,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;CACF;AAhGD,8CAgGC;AAED,SAAS,iBAAiB;IACxB,MAAM,OAAO,GAAI,UAAiF,CAAC,aAAa,CAAC;IACjH,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;AAC5B,CAAC"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -1,3 +1,3 @@
1
- export * from "./node";
2
- export * from "./browser";
3
- export * from "./pricing";
1
+ export * from "@volorio/core";
2
+ export * from "@volorio/server";
3
+ export * from "@volorio/rtc";
package/dist/src/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./node"), exports);
18
- __exportStar(require("./browser"), exports);
19
- __exportStar(require("./pricing"), exports);
17
+ __exportStar(require("@volorio/core"), exports);
18
+ __exportStar(require("@volorio/server"), exports);
19
+ __exportStar(require("@volorio/rtc"), exports);
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,4CAA0B;AAC1B,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,+CAA6B"}
@@ -1,28 +1 @@
1
- export interface VolorioServerClientOptions {
2
- apiBaseUrl: string;
3
- apiKey: string;
4
- fetch?: typeof fetch;
5
- }
6
- export interface CreateRoomSessionInput {
7
- projectId: string;
8
- roomId: string;
9
- identity: string;
10
- regionId?: string;
11
- ttlSeconds?: number;
12
- quality?: "voice" | "hd" | "fullhd" | "2k" | "4k";
13
- }
14
- export interface VolorioRoomSession {
15
- projectId: string;
16
- roomId: string;
17
- identity: string;
18
- token: string;
19
- livekitUrl: string;
20
- }
21
- export declare class VolorioServerClient {
22
- private readonly apiBaseUrl;
23
- private readonly apiKey;
24
- private readonly fetchImpl;
25
- constructor(options: VolorioServerClientOptions);
26
- createRoomSession(input: CreateRoomSessionInput): Promise<VolorioRoomSession>;
27
- private post;
28
- }
1
+ export * from "@volorio/server";
package/dist/src/node.js CHANGED
@@ -1,50 +1,18 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VolorioServerClient = void 0;
4
- class VolorioServerClient {
5
- apiBaseUrl;
6
- apiKey;
7
- fetchImpl;
8
- constructor(options) {
9
- this.apiBaseUrl = options.apiBaseUrl.replace(/\/+$/, "");
10
- this.apiKey = options.apiKey;
11
- this.fetchImpl = options.fetch ?? fetch;
12
- }
13
- async createRoomSession(input) {
14
- await this.post("/v1/media-rooms", {
15
- roomId: input.roomId,
16
- regionId: input.regionId ?? "default",
17
- metadata: JSON.stringify({ projectId: input.projectId, quality: input.quality ?? "hd" }),
18
- });
19
- const token = await this.post("/v1/tokens", {
20
- projectId: input.projectId,
21
- roomId: input.roomId,
22
- identity: input.identity,
23
- ttlSeconds: input.ttlSeconds ?? 3600,
24
- quality: input.quality ?? "hd",
25
- });
26
- return {
27
- projectId: input.projectId,
28
- roomId: input.roomId,
29
- identity: input.identity,
30
- token: token.token,
31
- livekitUrl: token.livekitUrl ?? "",
32
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
33
7
  }
34
- async post(path, body) {
35
- const response = await this.fetchImpl(`${this.apiBaseUrl}${path}`, {
36
- method: "POST",
37
- headers: {
38
- authorization: `Bearer ${this.apiKey}`,
39
- "content-type": "application/json",
40
- },
41
- body: JSON.stringify(body),
42
- });
43
- if (!response.ok) {
44
- throw new Error(`Volorio API ${path} returned ${response.status}: ${await response.text()}`);
45
- }
46
- return response.json();
47
- }
48
- }
49
- exports.VolorioServerClient = VolorioServerClient;
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("@volorio/server"), exports);
50
18
  //# sourceMappingURL=node.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":";;;AAuBA,MAAa,mBAAmB;IACb,UAAU,CAAS;IACnB,MAAM,CAAS;IACf,SAAS,CAAe;IAEzC,YAAY,OAAmC;QAC7C,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,KAA6B;QACnD,MAA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AAC,eAAe,IAAI,aAAa,QAAQ,CAAC,MAAM,KAAK,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/F,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAA2B,CAAC;IAClD,CAAC;CACF;AAlDD,kDAkDC"}
1
+ {"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
@@ -1,13 +1 @@
1
- export type VolorioProductUnit = "minute" | "participant_minute" | "message" | "monthly_active_user" | "month";
2
- export interface VolorioProductPrice {
3
- id: string;
4
- name: string;
5
- category: "core" | "media_service" | "ai_extension" | "addon" | "apaas";
6
- unit: VolorioProductUnit;
7
- unitPriceMicros: number;
8
- freeAllowance?: {
9
- quantity: number;
10
- period: "month" | "one_time";
11
- };
12
- }
13
- export declare const volorioPricingCatalog: readonly VolorioProductPrice[];
1
+ export * from "@volorio/core";
@@ -1,28 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.volorioPricingCatalog = void 0;
4
- exports.volorioPricingCatalog = [
5
- { id: "conversational_ai_platform", name: "Conversational AI Platform", category: "core", unit: "minute", unitPriceMicros: 100_000, freeAllowance: { quantity: 300, period: "one_time" } },
6
- { id: "rtc_voice", name: "RTC Voice", category: "core", unit: "participant_minute", unitPriceMicros: 590 },
7
- { id: "rtc_video_hd", name: "RTC Video HD", category: "core", unit: "participant_minute", unitPriceMicros: 590, freeAllowance: { quantity: 10_000, period: "month" } },
8
- { id: "rtc_video_fullhd", name: "RTC Video FullHD", category: "core", unit: "participant_minute", unitPriceMicros: 890 },
9
- { id: "rtc_video_2k", name: "RTC Video 2K", category: "core", unit: "participant_minute", unitPriceMicros: 1_490 },
10
- { id: "rtc_video_4k", name: "RTC Video 4K", category: "core", unit: "participant_minute", unitPriceMicros: 2_490 },
11
- { id: "live_streaming", name: "Live Streaming", category: "core", unit: "participant_minute", unitPriceMicros: 590 },
12
- { id: "screen_share", name: "Screen Share", category: "core", unit: "participant_minute", unitPriceMicros: 590 },
13
- { id: "signaling", name: "Signaling", category: "core", unit: "message", unitPriceMicros: 1_500, freeAllowance: { quantity: 1_000_000, period: "month" } },
14
- { id: "chat_mau", name: "Chat MAU", category: "core", unit: "monthly_active_user", unitPriceMicros: 50_000, freeAllowance: { quantity: 500, period: "month" } },
15
- { id: "speech_to_text", name: "Real-Time Speech to Text", category: "media_service", unit: "minute", unitPriceMicros: 16_990 },
16
- { id: "real_time_translation", name: "Real-Time Translation", category: "media_service", unit: "minute", unitPriceMicros: 8_990 },
17
- { id: "recording", name: "Recording", category: "media_service", unit: "minute", unitPriceMicros: 990 },
18
- { id: "media_gateway", name: "Media Gateway", category: "media_service", unit: "minute", unitPriceMicros: 990 },
19
- { id: "cloud_transcoding", name: "Cloud Transcoding", category: "media_service", unit: "minute", unitPriceMicros: 1_990 },
20
- { id: "media_push", name: "Media Push", category: "media_service", unit: "minute", unitPriceMicros: 1_990 },
21
- { id: "media_pull", name: "Media Pull", category: "media_service", unit: "minute", unitPriceMicros: 1_150 },
22
- { id: "ai_noise_suppression", name: "AI Noise Suppression", category: "ai_extension", unit: "minute", unitPriceMicros: 590, freeAllowance: { quantity: 10_000, period: "month" } },
23
- { id: "spatial_audio_3d", name: "3D Spatial Audio", category: "ai_extension", unit: "minute", unitPriceMicros: 990, freeAllowance: { quantity: 10_000, period: "month" } },
24
- { id: "interactive_whiteboard", name: "Interactive Whiteboard", category: "addon", unit: "minute", unitPriceMicros: 1_400, freeAllowance: { quantity: 10_000, period: "month" } },
25
- { id: "analytics", name: "Analytics", category: "addon", unit: "month", unitPriceMicros: 449_000_000 },
26
- { id: "flexible_classroom", name: "Flexible Classroom", category: "apaas", unit: "minute", unitPriceMicros: 2_190, freeAllowance: { quantity: 10_000, period: "month" } },
27
- ];
17
+ __exportStar(require("@volorio/core"), exports);
28
18
  //# sourceMappingURL=pricing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/pricing.ts"],"names":[],"mappings":";;;AAmBa,QAAA,qBAAqB,GAAmC;IACnE,EAAE,EAAE,EAAE,4BAA4B,EAAE,IAAI,EAAE,4BAA4B,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE;IAC1L,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,EAAE;IAC1G,EAAE,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IACtK,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,EAAE;IACxH,E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,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;IACjL,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE;IACtG,EAAE,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;CAC1K,CAAC"}
1
+ {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../../src/pricing.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@volorio/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
- "description": "Volorio RTC, chat, usage, and billing SDK for Node.js and browsers.",
5
+ "description": "Volorio RTC, chat, usage, billing, and media services SDK for Node.js and browsers.",
6
6
  "main": "dist/src/index.js",
7
7
  "types": "dist/src/index.d.ts",
8
8
  "exports": {
@@ -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",
@@ -36,12 +37,24 @@
36
37
  "test": "tsc -p tsconfig.json && node --test dist/test/*.spec.js",
37
38
  "pack:local": "pnpm build && npm pack --pack-destination dist"
38
39
  },
39
- "peerDependencies": {
40
- "livekit-client": "^2.0.0"
40
+ "dependencies": {
41
+ "@volorio/core": "^0.2.0",
42
+ "@volorio/rtc": "^0.2.0",
43
+ "@volorio/server": "^0.2.0"
41
44
  },
42
- "peerDependenciesMeta": {
43
- "livekit-client": {
44
- "optional": true
45
- }
46
- }
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
+ ]
47
60
  }