Hosted Experience
Events
3min
there may be times when you want even more fine tuned control of your client application, and to synchronise your website with the state of the digital human for this, we provide message events from the digital human application that may be consumed by your web client to do this, you may listen to window event uneeqmessage example the below code example demonstrates how you can listen for messages, and in this case update the class list of the body element when the session becomes live there are many more message events you may want to listen for, these are listed below window\ addeventlistener( 'uneeqmessage', (event) => { const msg = event detail; console log('uneeq message ', msg); switch( msg uneeqmessagetype ){ case 'sessionstateupdate' if( msg live ) { document body classlist add('uneeq session live'); } else { document body classlist remove('uneeq session live'); } break; // add additional event handlers here default break; } }); messages the complete list of messages you may listen for are defined below notification sessionstateupdate calltoactiondismissed frameready micpermissiondenied custommetadataupdated sessionlive sessionended avatarunavailable avataranswercontent promptrequest promptresult (transcript is not sanitized for xss) deviceerror serviceunavailable sessionerror instructions recordingstarted recordingstopped userstartedspeaking userstoppedspeaking digitalhumanplayedinmutedmodesuccess digitalhumanunmuted enablemicrophoneupdated speechtranscription vadinterruptionallowed sessionreconnecting avatarstoppedspeaking avatarstartedspeaking vadinterruptionallowed sessionreconnecting sessiondisconnected speechevent waitinginqueue webrtcstats