@ravenkash/rtc 0.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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.cjs +2333 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +622 -0
- package/dist/index.d.ts +622 -0
- package/dist/index.js +2319 -0
- package/dist/index.js.map +1 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Raven
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @ravenkash/rtc
|
|
2
|
+
|
|
3
|
+
Raven's browser RTC SDK — join a room, publish camera and microphone,
|
|
4
|
+
subscribe to remote media. Hides SDP, ICE, STUN, TURN and the media server
|
|
5
|
+
behind a small typed API.
|
|
6
|
+
|
|
7
|
+
Part of [Raven](https://github.com/atulsinghhhh/Raven), open-source real-time communication infrastructure.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @ravenkash/rtc
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Use
|
|
16
|
+
|
|
17
|
+
The token and endpoint come from your own backend — never mint them in a
|
|
18
|
+
browser. See [`@ravenkash/server`](https://www.npmjs.com/package/@ravenkash/server)
|
|
19
|
+
or [`raven-sdk`](https://pypi.org/project/raven-sdk/) for Python.
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { createRTCClient } from '@ravenkash/rtc';
|
|
23
|
+
|
|
24
|
+
const client = createRTCClient({
|
|
25
|
+
token: grant.token,
|
|
26
|
+
endpoint: grant.endpoint, // Raven's signaling WebSocket
|
|
27
|
+
iceServers: grant.iceServers, // forward as-is; never hand-build STUN/TURN config
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const room = await client.join(roomId);
|
|
31
|
+
|
|
32
|
+
await room.enableCamera();
|
|
33
|
+
await room.enableMicrophone();
|
|
34
|
+
|
|
35
|
+
room.on('trackSubscribed', (track) => {
|
|
36
|
+
document.body.appendChild(track.attach());
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`join()` resolves once the **control plane** admits you. You can publish
|
|
41
|
+
immediately, but ICE and DTLS finish a moment later — render from the
|
|
42
|
+
`connected` event rather than assuming:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
room.on('connected', () => setStatus('live'));
|
|
46
|
+
// or, if you must block: await room.waitUntilConnected();
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Exports
|
|
50
|
+
|
|
51
|
+
`createRTCClient`, `RTCClient`, `Room`, `Participant`,
|
|
52
|
+
`LocalParticipant`, `RemoteParticipant`, `Track`, `LocalTrack`,
|
|
53
|
+
`RemoteTrack`, `RTCError`, `isRTCError`.
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
- [Browser SDK reference](https://github.com/atulsinghhhh/Raven/blob/main/docs/sdk.md)
|
|
58
|
+
- [RTC architecture](https://github.com/atulsinghhhh/Raven/blob/main/docs/rtc/architecture.md)
|
|
59
|
+
- [Signaling protocol](https://github.com/atulsinghhhh/Raven/blob/main/docs/rtc/signaling.md)
|
|
60
|
+
- [What is and is not tested](https://github.com/atulsinghhhh/Raven/blob/main/docs/rtc/test-matrix.md)
|
|
61
|
+
- Runnable examples: [`video-call`](https://github.com/atulsinghhhh/Raven/tree/main/examples/video-call)
|
|
62
|
+
|
|
63
|
+
## React?
|
|
64
|
+
|
|
65
|
+
Use [`@ravenkash/react`](https://www.npmjs.com/package/@ravenkash/react) —
|
|
66
|
+
headless hooks over this package, with optional components.
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
MIT
|