Hosted Experience
Events
3 min
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 avataranswercontent avatarstartedspeaking avatarstoppedspeaking avatarunavailable calltoactiondismissed custommetadataupdated deviceerror digitalhumanplayedinmutedmodesuccess digitalhumanunmuted enablemicrophoneupdated frameready instructions micpermissiondenied notification promptrequest promptresult (transcript is not sanitized for xss) recordingstarted recordingstopped serviceunavailable sessiondisconnected sessionended sessionerror sessionlive sessionreconnecting sessionreconnectingfinished sessionstateupdate softswitchfinished softswitchstarting speechevent speechtranscription userstartedspeaking userstoppedspeaking vadinterruptionallowed videolayoutconfiguring waitinginqueue webrtcstats