mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-15 21:33:23 +00:00
Add Node.js support via WebRTC polyfill injection
- Added WebRTCPolyfill interface for injecting WebRTC implementations - Added wrtc option to RondevuOptions and RondevuConnectionParams - Updated Rondevu and RondevuConnection to use injected APIs - Added helpful error message when RTCPeerConnection is not available - Updated README with Node.js usage examples - Version bumped to 0.3.0 Fixes: RTCPeerConnection not defined error in Node.js 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
12
src/types.ts
12
src/types.ts
@@ -177,6 +177,15 @@ export interface RondevuClientOptions {
|
||||
// WebRTC Types
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* WebRTC polyfill for Node.js and other non-browser platforms
|
||||
*/
|
||||
export interface WebRTCPolyfill {
|
||||
RTCPeerConnection: typeof RTCPeerConnection;
|
||||
RTCSessionDescription: typeof RTCSessionDescription;
|
||||
RTCIceCandidate: typeof RTCIceCandidate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration options for Rondevu WebRTC client
|
||||
*/
|
||||
@@ -193,6 +202,8 @@ export interface RondevuOptions {
|
||||
pollingInterval?: number;
|
||||
/** Connection timeout in milliseconds (default: 30000) */
|
||||
connectionTimeout?: number;
|
||||
/** WebRTC polyfill for Node.js (e.g., wrtc or @roamhq/wrtc) */
|
||||
wrtc?: WebRTCPolyfill;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,6 +233,7 @@ export interface RondevuConnectionParams {
|
||||
remotePeerId: string;
|
||||
pollingInterval: number;
|
||||
connectionTimeout: number;
|
||||
wrtc?: WebRTCPolyfill;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user