mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-15 20:43:23 +00:00
Update to use Rondevu.connect() and ICE server presets
- Replace new Rondevu() + initialize() with Rondevu.connect() - Use rtcPreset state variable for iceServers option - Update NODE_HOST_GUIDE.md examples to use presets and new API 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -175,13 +175,13 @@ export default function App() {
|
||||
// Check if we have a saved username and if it's claimed
|
||||
if (savedUsername && savedKeypair) {
|
||||
// Create Rondevu instance with saved credentials
|
||||
const service = new Rondevu({
|
||||
const service = await Rondevu.connect({
|
||||
apiUrl: API_URL,
|
||||
username: savedUsername,
|
||||
keypair: parsedKeypair,
|
||||
iceServers: rtcPreset, // Use preset: 'ipv4-turn', 'hostname-turns', 'google-stun', or 'relay-only'
|
||||
});
|
||||
|
||||
await service.initialize();
|
||||
setRondevu(service);
|
||||
|
||||
console.log('[Init] Checking if username is claimed...');
|
||||
@@ -332,12 +332,12 @@ export default function App() {
|
||||
|
||||
try {
|
||||
// Create new Rondevu instance (will generate keypair if needed)
|
||||
const newService = new Rondevu({
|
||||
const newService = await Rondevu.connect({
|
||||
apiUrl: API_URL,
|
||||
username: usernameInput,
|
||||
keypair: rondevu?.getKeypair(), // Use existing keypair if available, otherwise will generate new one
|
||||
iceServers: rtcPreset, // Use preset: 'ipv4-turn', 'hostname-turns', 'google-stun', or 'relay-only'
|
||||
});
|
||||
await newService.initialize();
|
||||
// Username will be auto-claimed on first publish
|
||||
|
||||
const keypair = newService.getKeypair();
|
||||
|
||||
Reference in New Issue
Block a user