@pulsebeam/peer 0.0.16 → 0.0.17
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 +44 -9
- package/package.json +1 -1
package/README.md
CHANGED
@@ -2,14 +2,28 @@
|
|
2
2
|
|
3
3
|
Simplifies real-time application development. Defines signaling protocol for connection establishment, handling media and data transmission, and provides infrastructure.
|
4
4
|
|
5
|
-
|
5
|
+
## Features
|
6
6
|
|
7
7
|
- Media & Data Support: Transmit audio, video, and/or data channels within your applications.
|
8
8
|
- Abstracted Signaling: Handles the exchange of information required to set up WebRTC connections, relieving you of low-level details.
|
9
9
|
- Automatic Reconnection: Maintains connection stability by automatically re-establishing connections when disruptions occur.
|
10
10
|
- Opt out of Peer-to-Peer: Can configure to force server-relayed communication.
|
11
11
|
|
12
|
-
|
12
|
+
## Status
|
13
|
+
|
14
|
+
> [!WARNING]
|
15
|
+
> This SDK is currently in **Developer Preview**. During this phase:
|
16
|
+
> - APIs are subject to breaking changes
|
17
|
+
> - Stability issues may occur
|
18
|
+
> - Core functionality is still being validated
|
19
|
+
>
|
20
|
+
> **We value your input!**
|
21
|
+
> Report bugs, suggest improvements, or collaborate directly with our team:
|
22
|
+
>
|
23
|
+
> • [Create GitHub Issues](https://github.com/PulseBeamDev/pulsebeam-js/issues)
|
24
|
+
> • [Join PulseBeam Developer Discord](https://discord.gg/Bhd3t9afuB)
|
25
|
+
|
26
|
+
## Installation
|
13
27
|
|
14
28
|
Install and import the package using npm, deno, or yarn:
|
15
29
|
|
@@ -34,7 +48,7 @@ Import symbol
|
|
34
48
|
`import * as peer from "@pulsebeam/peer";`
|
35
49
|
|
36
50
|
|
37
|
-
|
51
|
+
## Usage
|
38
52
|
|
39
53
|
Here's an example demonstrating how to use @pulsebeam/peer to establish a peer-to-peer connection:
|
40
54
|
|
@@ -43,12 +57,11 @@ import { Peer, createPeer } from "@pulsebeam/peer";
|
|
43
57
|
|
44
58
|
// Obtain an authentication token (implementation specific)
|
45
59
|
const authResponse = await fetch("/auth");
|
46
|
-
const { groupId,
|
60
|
+
const { groupId, token } = await authResponse.json();
|
47
61
|
|
48
62
|
// Create a Peer instance
|
49
|
-
const peer = await createPeer({
|
63
|
+
const peer = await createPeer({ token });
|
50
64
|
|
51
|
-
// Define handlers for incoming events (optional)
|
52
65
|
peer.onsession = (session) => {
|
53
66
|
session.ontrack = ({ streams }) => console.log("New media stream:", streams);
|
54
67
|
session.ondatachannel = (event) => console.log("Data channel:", event.channel);
|
@@ -65,14 +78,36 @@ await peer.connect(groupId, "bob", abortController.signal);
|
|
65
78
|
|
66
79
|
This example retrieves an authentication token (implementation details will vary depending on your setup), creates a Peer instance, and defines event handlers for receiving media streams, data channels, and connection state changes (optional). Finally, it starts connection attempts and connects to a specific peer identified by its ID within the group.
|
67
80
|
|
68
|
-
|
81
|
+
## Documentation
|
69
82
|
|
70
83
|
For documentation, API keys, and usage scenarios, please refer to the official PulseBeam documentation:
|
71
84
|
|
72
|
-
* https://pulsebeam.dev/docs
|
85
|
+
* Guide: https://pulsebeam.dev/docs
|
86
|
+
* Client SDK Reference: https://jsr.io/@pulsebeam/peer
|
87
|
+
* Server SDK Reference: https://jsr.io/@pulsebeam/server
|
88
|
+
|
89
|
+
## Semantic Versioning
|
90
|
+
|
91
|
+
This project adheres to [Semantic Versioning 2.0.0](https://semver.org/).
|
73
92
|
|
74
|
-
|
93
|
+
* **MAJOR version (X.y.z):** Incompatible API changes.
|
94
|
+
* **MINOR version (x.Y.z):** Functionality added in a backwards compatible manner.
|
95
|
+
* **PATCH version (x.y.Z):** Backwards compatible bug fixes.
|
96
|
+
|
97
|
+
## WebRTC Resources
|
75
98
|
|
76
99
|
For a deeper understanding of WebRTC concepts, consult the official WebRTC documentation:
|
77
100
|
|
78
101
|
* https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API
|
102
|
+
|
103
|
+
## Related Links
|
104
|
+
|
105
|
+
|Name|Link|
|
106
|
+
|-|-|
|
107
|
+
|Client SDK|https://github.com/PulseBeamDev/pulsebeam-js|
|
108
|
+
|Server SDK|https://github.com/PulseBeamDev/pulsebeam-core|
|
109
|
+
|FOSS Server|https://github.com/PulseBeamDev/pulsebeam-server-foss|
|
110
|
+
|Signaling Protocol|https://github.com/PulseBeamDev/pulsebeam-proto|
|
111
|
+
|Documentation|https://github.com/PulseBeamDev/docs|
|
112
|
+
|PulseBeam Cloud|https://cloud.pulsebeam.dev|
|
113
|
+
|