Discussions

Ask a Question
Back to All

Realtime avatar domain specific faillure

I'm encountering an issue with streamingAvatar.startVoiceChat() using the @heygen/streaming-avatar@^2.0.12 SDK (or the latest 2.x version). The call to createStartAvatar completes successfully, and the STREAM_READY event fires for the video stream. However, the subsequent await streamingAvatar.startVoiceChat() call either hangs indefinitely (observed in Chrome) or fails with an explicit WebSocket connection error to wss://api.heygen.com/v1/ws/streaming.chat (observed in Chrome developer logs). The microphone does not activate.

Notable Details:

  • This setup (same machine, network, localhost, same code) previously worked correctly.
  • A direct test using navigator.mediaDevices.getUserMedia({ audio: true }) on the same page succeeds, confirming basic browser mic access is functioning.
  • Local firewall/network issues have been ruled out as the cause.
  • The token gets retrieved, but the WebSocket connection fails.
  • With every new build and/or a different API key, the streaming avatar works on some domains and not on others.
  • On some days, we get a WebSocket connection error, while other days no error appears, but the avatar still does not pop up on arround 70%-90% of deployment. Faillure of avatars is increasing even on deployments without code changes

Recent Updates:

  • I’ve tried various troubleshooting steps, including changing servers, domains, and code flows, and using custom proxies.
  • I’ve also tested with different API keys, and the issue seems domain-specific . Some domains work while others do not.
  • Today, we observed the issue also occurring on our production environment, which had previously been functioning.

Request:
Could someone please advise if this is a known issue, or if there has been a recent change in security, domain handling, or WebSocket initialization?

Thank you!