Hey everyone,
I’m trying to add a mute button to our custom web widget for agents. We’re using the Genesys Cloud JavaScript SDK (v1.5.2) to build a simple self-service tool for our Chicago BPO team. The goal is straightforward: let the agent click a button to mute their microphone during an active voice conversation.
I’ve been digging through the -platform-client docs, but I can’t find a clear method for toggling the mute state on the client side. I see methods for creating conversations and transferring calls, but nothing obvious for local media control like setMute(true) or similar.
Here’s the basic setup I have so far. I’m initializing the client and getting the conversation details:
import { PlatformClient } from '@genesyscloud/-platform-client';
const client = new PlatformClient();
// ... auth logic omitted for brevity ...
async function handleMuteToggle(conversationId) {
try {
const conv = await client.conversationsApi.getConversation(conversationId);
console.log('Current state:', conv.participants);
// I'm stuck here. How do I change the muted state?
// client.conversationsApi.updateConversationParticipant?
} catch (error) {
console.error('Failed to toggle mute:', error);
}
}
I tried looking at updateConversationParticipant but that seems to be for admin actions or updating skills, not real-time media control. I also checked if there’s a WebSocket event I can listen to, but I need to trigger the change, not just monitor it.
Is there a specific API call I’m missing? Or is this something that only works through the native desktop client SDK and not the web-based JS SDK? I don’t want to force agents to use the desktop app if a simple web button can do it.
Any pointers would be appreciated. I’ve been spinning my wheels on this for two days.