mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
96084ebe63a3d5faf8cdbb732f4e9dbaebba82d5
- Add npm version badge - Update header with tagline - Improve README structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Rondevu
🎯 Meet WebRTC peers by topic, by peer ID, or by connection ID.
@xtr-dev/rondevu-client
TypeScript 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
Description
Languages
TypeScript
96.1%
JavaScript
3.9%