mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
- Add Rondevu class with join(), connect(), and create() methods
- Add RondevuConnection wrapper for WebRTC connections
- Add event emitter for connection events
- Update to ES modules (ESNext) for Vite compatibility
- Simplify README to be more concise
- Update package.json to specify type: module
Three ways to connect:
- join(topic) for auto-discovery
- join(topic, {filter}) for peer ID filtering
- create(id)/connect(id) for direct connections
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
1.3 KiB
1.3 KiB
Rondevu
🎯 Meet WebRTC peers by topic, by peer ID, or by connection ID.
@xtr-dev/rondevu-client
Rondevu HTTP and WebRTC client, for simple peer discovery and connection.
Install
npm install @xtr-dev/rondevu-client
Usage
import { Rondevu } from '@xtr-dev/rondevu-client';
const rdv = new Rondevu({ baseUrl: 'https://server.com' });
// Connect by topic
const conn = await rdv.join('room');
// Or connect by ID
const conn = await rdv.connect('meeting-123');
// Use the connection
conn.on('connect', () => {
const channel = conn.dataChannel('chat');
channel.send('Hello!');
});
API
Main Methods:
rdv.join(topic)- Auto-connect to first peer in topicrdv.join(topic, {filter})- Connect to specific peer by IDrdv.create(id, topic)- Create connection for others to joinrdv.connect(id)- Join connection by ID
Connection Events:
connect- Connection establisheddisconnect- Connection closeddatachannel- Remote peer created data channelstream- Remote media stream receivederror- Error occurred
Connection Methods:
conn.dataChannel(label)- Get or create data channelconn.addStream(stream)- Add media streamconn.getPeerConnection()- Get underlying RTCPeerConnectionconn.close()- Close connection
License
MIT