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:
2025-12-12 22:13:13 +01:00
parent b9c07aeb5a
commit 9b5b35ef7d
2 changed files with 17 additions and 16 deletions

View File

@@ -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();