mediasfu-shared 1.0.3 → 1.0.4

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.
Files changed (2) hide show
  1. package/README.md +108 -103
  2. package/package.json +99 -96
package/README.md CHANGED
@@ -1,103 +1,108 @@
1
- # mediasfu-shared
2
-
3
- `mediasfu-shared` is the framework-agnostic MediaSFU runtime package. It exposes the shared room helpers, mediasoup/socket flows, state utilities, and TypeScript types used by the MediaSFU SDK family.
4
-
5
- ## When To Use This Package
6
-
7
- Use `mediasfu-shared` when you want to:
8
-
9
- - build your own browser client on top of MediaSFU primitives without adopting a framework-specific UI package
10
- - share MediaSFU room, media, and participant logic across React, Vue, Angular, Svelte, or plain TypeScript codebases
11
- - import low-level helpers such as `createRoomOnMediaSFU`, `joinRoomOnMediaSFU`, `connectSocket`, `SocketManager`, and the exported consumers, methods, and types entry points
12
-
13
- ## Installation
14
-
15
- ```bash
16
- npm install mediasfu-shared mediasoup-client socket.io-client
17
- ```
18
-
19
- `mediasoup-client` and `socket.io-client` are peer dependencies, so install them in the host app.
20
-
21
- ## Backend Requirement
22
-
23
- The cloud room helpers in this package target `https://mediasfu.com/v1/rooms/` by default.
24
-
25
- - Use MediaSFU Cloud when you want managed room creation, signaling, and media routing. Pass `apiUserName` and `apiKey`.
26
- - Use MediaSFU Open / Community Edition when you self-host. Pass a non-MediaSFU `localLink` such as `http://localhost:3000`.
27
-
28
- ## Quick Example
29
-
30
- ```ts
31
- import {
32
- SocketManager,
33
- connectSocket,
34
- createRoomOnMediaSFU,
35
- joinRoomOnMediaSFU,
36
- } from 'mediasfu-shared';
37
-
38
- const createResult = await createRoomOnMediaSFU({
39
- payload: {
40
- action: 'create',
41
- userName: 'Ada',
42
- duration: 60,
43
- capacity: 10,
44
- },
45
- apiUserName: 'your-api-username',
46
- apiKey: 'your-64-character-api-key',
47
- });
48
-
49
- const joinResult = await joinRoomOnMediaSFU({
50
- payload: {
51
- action: 'join',
52
- meetingID: 'room123',
53
- userName: 'Ben',
54
- },
55
- apiUserName: 'your-api-username',
56
- apiKey: 'your-64-character-api-key',
57
- });
58
-
59
- const socket = await connectSocket({
60
- apiUserName: 'your-api-username',
61
- apiKey: 'your-64-character-api-key',
62
- apiToken: 'your-api-token',
63
- link: 'https://mediasfu.com/socket',
64
- });
65
-
66
- const socketManager = new SocketManager({ socket });
67
-
68
- console.log(createResult.success, joinResult.success, socketManager.socket.connected);
69
- ```
70
-
71
- ## Import Paths
72
-
73
- - `mediasfu-shared` exposes the full public runtime surface.
74
- - `mediasfu-shared/consumers` is useful when you want consumer/grid helpers only.
75
- - `mediasfu-shared/methods` is useful when you want action utilities and room helpers.
76
- - `mediasfu-shared/types` is useful when you only need TypeScript contracts.
77
-
78
- ## Documentation
79
-
80
- - Main docs: [https://mediasfu.com/documentation](https://mediasfu.com/documentation)
81
- - User guide: [https://mediasfu.com/user-guide](https://mediasfu.com/user-guide)
82
- - MediaSFU Open / CE: [https://github.com/MediaSFU/MediaSFUOpen](https://github.com/MediaSFU/MediaSFUOpen)
83
-
84
- Generate package-local API docs with:
85
-
86
- ```bash
87
- npm run build-docs
88
- ```
89
-
90
- ## Related Packages
91
-
92
- - [mediasfu-reactjs](https://www.npmjs.com/package/mediasfu-reactjs)
93
- - [mediasfu-vue](https://www.npmjs.com/package/mediasfu-vue)
94
- - [mediasfu-angular](https://www.npmjs.com/package/mediasfu-angular)
95
-
96
- ## Support
97
-
98
- - GitHub issues: [https://github.com/MediaSFU/MediaSFU-Shared/issues](https://github.com/MediaSFU/MediaSFU-Shared/issues)
99
- - Email: info@mediasfu.com
100
-
101
- ## License
102
-
103
- MIT. See [LICENSE](LICENSE).
1
+ # mediasfu-shared · [mediasfu-shared on npm](https://www.npmjs.com/package/mediasfu-shared)
2
+
3
+ **mediasfu-shared** is the framework-agnostic WebRTC runtime at the core of the MediaSFU SDK family. It provides shared room helpers, mediasoup signaling, socket management, media state utilities, and TypeScript types for React, Vue, Angular, Svelte, and plain TypeScript. Install with `npm install mediasfu-shared`.
4
+
5
+ `mediasfu-shared` is the framework-agnostic MediaSFU runtime package. It exposes the shared room helpers, mediasoup/socket flows, state utilities, and TypeScript types used by the MediaSFU SDK family.
6
+
7
+ ## When To Use This Package
8
+
9
+ Use `mediasfu-shared` when you want to:
10
+
11
+ - build your own browser client on top of MediaSFU primitives without adopting a framework-specific UI package
12
+ - share MediaSFU room, media, and participant logic across React, Vue, Angular, Svelte, or plain TypeScript codebases
13
+ - import low-level helpers such as `createRoomOnMediaSFU`, `joinRoomOnMediaSFU`, `connectSocket`, `SocketManager`, and the exported consumers, methods, and types entry points
14
+
15
+ ## Installation
16
+
17
+ ```bash
18
+ npm install mediasfu-shared mediasoup-client socket.io-client
19
+ ```
20
+
21
+ `mediasoup-client` and `socket.io-client` are peer dependencies, so install them in the host app.
22
+
23
+ ## Backend Requirement
24
+
25
+ The cloud room helpers in this package target `https://mediasfu.com/v1/rooms/` by default.
26
+
27
+ - Use MediaSFU Cloud when you want managed room creation, signaling, and media routing. Pass `apiUserName` and `apiKey`.
28
+ - Use MediaSFU Open / Community Edition when you self-host. Pass a non-MediaSFU `localLink` such as `http://localhost:3000`.
29
+
30
+ ## Quick Example
31
+
32
+ ```ts
33
+ import {
34
+ SocketManager,
35
+ connectSocket,
36
+ createRoomOnMediaSFU,
37
+ joinRoomOnMediaSFU,
38
+ } from 'mediasfu-shared';
39
+
40
+ const createResult = await createRoomOnMediaSFU({
41
+ payload: {
42
+ action: 'create',
43
+ userName: 'Ada',
44
+ duration: 60,
45
+ capacity: 10,
46
+ },
47
+ apiUserName: 'your-api-username',
48
+ apiKey: 'your-64-character-api-key',
49
+ });
50
+
51
+ const joinResult = await joinRoomOnMediaSFU({
52
+ payload: {
53
+ action: 'join',
54
+ meetingID: 'room123',
55
+ userName: 'Ben',
56
+ },
57
+ apiUserName: 'your-api-username',
58
+ apiKey: 'your-64-character-api-key',
59
+ });
60
+
61
+ const socket = await connectSocket({
62
+ apiUserName: 'your-api-username',
63
+ apiKey: 'your-64-character-api-key',
64
+ apiToken: 'your-api-token',
65
+ link: 'https://mediasfu.com/socket',
66
+ });
67
+
68
+ const socketManager = new SocketManager({ socket });
69
+
70
+ console.log(createResult.success, joinResult.success, socketManager.socket.connected);
71
+ ```
72
+
73
+ ## Import Paths
74
+
75
+ - `mediasfu-shared` exposes the full public runtime surface.
76
+ - `mediasfu-shared/consumers` is useful when you want consumer/grid helpers only.
77
+ - `mediasfu-shared/methods` is useful when you want action utilities and room helpers.
78
+ - `mediasfu-shared/types` is useful when you only need TypeScript contracts.
79
+
80
+ ## Documentation
81
+
82
+ - Main docs: [https://mediasfu.com/documentation](https://mediasfu.com/documentation)
83
+ - User guide: [https://mediasfu.com/user-guide](https://mediasfu.com/user-guide)
84
+ - MediaSFU Open / CE: [https://github.com/MediaSFU/MediaSFUOpen](https://github.com/MediaSFU/MediaSFUOpen)
85
+
86
+ Generate package-local API docs with:
87
+
88
+ ```bash
89
+ npm run build-docs
90
+ ```
91
+
92
+ ## Related Packages
93
+
94
+ | Package | Framework | npm |
95
+ |---------|-----------|-----|
96
+ | [mediasfu-reactjs](https://github.com/MediaSFU/MediaSFU-ReactJS) | React 18/19 | [`npm install mediasfu-reactjs`](https://www.npmjs.com/package/mediasfu-reactjs) |
97
+ | [mediasfu-vue](https://github.com/MediaSFU/MediaSFU-Vue) | Vue 3 / Composition API | [`npm install mediasfu-vue`](https://www.npmjs.com/package/mediasfu-vue) |
98
+ | [mediasfu-angular](https://github.com/MediaSFU/MediaSFU-Angular) | Angular 17/18/19 | [`npm install mediasfu-angular`](https://www.npmjs.com/package/mediasfu-angular) |
99
+ | [mediasfu-reactnative](https://www.npmjs.com/package/mediasfu-reactnative) | React Native | [`npm install mediasfu-reactnative`](https://www.npmjs.com/package/mediasfu-reactnative) |
100
+
101
+ ## Support
102
+
103
+ - GitHub issues: [https://github.com/MediaSFU/MediaSFU-Shared/issues](https://github.com/MediaSFU/MediaSFU-Shared/issues)
104
+ - Email: info@mediasfu.com
105
+
106
+ ## License
107
+
108
+ MIT. See [LICENSE](LICENSE).
package/package.json CHANGED
@@ -1,96 +1,99 @@
1
- {
2
- "name": "mediasfu-shared",
3
- "version": "1.0.3",
4
- "description": "Framework-agnostic MediaSFU WebRTC runtime for room creation, joining, mediasoup signaling, sockets, media state, translation, and reusable SDK types",
5
- "main": "dist/index.cjs",
6
- "module": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "type": "module",
9
- "exports": {
10
- ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs"
14
- },
15
- "./consumers": {
16
- "types": "./dist/consumers/index.d.ts",
17
- "import": "./dist/consumers/index.js",
18
- "require": "./dist/consumers/index.cjs"
19
- },
20
- "./methods": {
21
- "types": "./dist/methods/index.d.ts",
22
- "import": "./dist/methods/index.js",
23
- "require": "./dist/methods/index.cjs"
24
- },
25
- "./types": {
26
- "types": "./dist/types/index.d.ts",
27
- "import": "./dist/types/index.js",
28
- "require": "./dist/types/index.cjs"
29
- }
30
- },
31
- "files": [
32
- "dist",
33
- "src",
34
- "README.md",
35
- "LICENSE"
36
- ],
37
- "scripts": {
38
- "build": "tsc && vite build",
39
- "build-docs": "typedoc",
40
- "dev": "vite build --watch",
41
- "test:staging:smoke": "npm run build && node ./scripts/staging-room-smoke-test.cjs",
42
- "type-check": "tsc --noEmit"
43
- },
44
- "keywords": [
45
- "mediasfu",
46
- "webrtc",
47
- "webRTC",
48
- "mediasoup",
49
- "sfu",
50
- "video-conferencing",
51
- "video-call",
52
- "audio-call",
53
- "socket.io",
54
- "real-time-communication",
55
- "real-time-media",
56
- "room-management",
57
- "screen-sharing",
58
- "recording",
59
- "live-streaming",
60
- "webinar",
61
- "broadcasting",
62
- "whiteboard",
63
- "live-subtitles",
64
- "translation",
65
- "framework-agnostic",
66
- "typescript",
67
- "mediasfu-shared"
68
- ],
69
- "author": "MediaSFU",
70
- "license": "MIT",
71
- "repository": {
72
- "type": "git",
73
- "url": "https://github.com/MediaSFU/MediaSFU-Shared"
74
- },
75
- "homepage": "https://github.com/MediaSFU/MediaSFU-Shared",
76
- "bugs": {
77
- "url": "https://github.com/MediaSFU/MediaSFU-Shared/issues",
78
- "email": "info@mediasfu.com"
79
- },
80
- "peerDependencies": {
81
- "mediasoup-client": "^3.16.0",
82
- "socket.io-client": "^4.8.0"
83
- },
84
- "dependencies": {
85
- "universal-cookie": "^7.2.2"
86
- },
87
- "devDependencies": {
88
- "mediasoup-client": "^3.16.0",
89
- "socket.io-client": "^4.8.0",
90
- "typedoc": "^0.28.14",
91
- "typedoc-plugin-extras": "^4.0.1",
92
- "typescript": "^5.9.3",
93
- "vite": "^7.1.9",
94
- "vite-plugin-dts": "^4.3.0"
95
- }
96
- }
1
+ {
2
+ "name": "mediasfu-shared",
3
+ "version": "1.0.4",
4
+ "description": "mediasfu-shared – framework-agnostic WebRTC runtime for MediaSFU. Room helpers, mediasoup signaling, socket management, media state, and TypeScript types for React, Vue, Angular, Svelte, and plain TS.",
5
+ "main": "dist/index.cjs",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "type": "module",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./consumers": {
16
+ "types": "./dist/consumers/index.d.ts",
17
+ "import": "./dist/consumers/index.js",
18
+ "require": "./dist/consumers/index.cjs"
19
+ },
20
+ "./methods": {
21
+ "types": "./dist/methods/index.d.ts",
22
+ "import": "./dist/methods/index.js",
23
+ "require": "./dist/methods/index.cjs"
24
+ },
25
+ "./types": {
26
+ "types": "./dist/types/index.d.ts",
27
+ "import": "./dist/types/index.js",
28
+ "require": "./dist/types/index.cjs"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src",
34
+ "README.md",
35
+ "LICENSE"
36
+ ],
37
+ "scripts": {
38
+ "build": "tsc && vite build",
39
+ "build-docs": "typedoc",
40
+ "dev": "vite build --watch",
41
+ "test:staging:smoke": "npm run build && node ./scripts/staging-room-smoke-test.cjs",
42
+ "type-check": "tsc --noEmit"
43
+ },
44
+ "keywords": [
45
+ "mediasfu",
46
+ "mediasfu-shared",
47
+ "webrtc",
48
+ "mediasoup",
49
+ "socket.io",
50
+ "sfu",
51
+ "video conferencing",
52
+ "video call",
53
+ "webinar",
54
+ "live streaming",
55
+ "recording",
56
+ "whiteboard",
57
+ "translation",
58
+ "live subtitles",
59
+ "room management",
60
+ "screen sharing",
61
+ "real-time communication",
62
+ "framework-agnostic",
63
+ "typescript",
64
+ "react",
65
+ "vue",
66
+ "angular",
67
+ "svelte",
68
+ "mediasfu sdk",
69
+ "mediasfu runtime",
70
+ "mediasfu shared"
71
+ ],
72
+ "author": "MediaSFU",
73
+ "license": "MIT",
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "https://github.com/MediaSFU/MediaSFU-Shared"
77
+ },
78
+ "homepage": "https://www.npmjs.com/package/mediasfu-shared",
79
+ "bugs": {
80
+ "url": "https://github.com/MediaSFU/MediaSFU-Shared/issues",
81
+ "email": "info@mediasfu.com"
82
+ },
83
+ "peerDependencies": {
84
+ "mediasoup-client": "^3.20.0",
85
+ "socket.io-client": "^4.8.0"
86
+ },
87
+ "dependencies": {
88
+ "universal-cookie": "^7.2.2"
89
+ },
90
+ "devDependencies": {
91
+ "mediasoup-client": "^3.20.0",
92
+ "socket.io-client": "^4.8.0",
93
+ "typedoc": "^0.28.14",
94
+ "typedoc-plugin-extras": "^4.0.1",
95
+ "typescript": "^5.9.3",
96
+ "vite": "^7.1.9",
97
+ "vite-plugin-dts": "^4.3.0"
98
+ }
99
+ }