Documentation Index Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Web SDK emits events when the ambient session state changes. Listen for these events to track the state of the ambient session and handle responses accordingly.
For more information, refer to the Emitter-events-type section.
Code example
The example below demonstrates how to listen for ambient events in the web SDK.
import { SukiAssistant , SukiProvider , useSuki } from " @suki-sdk/react " ;
function MyComponent () {
const { on , activeAmbientId } = useSuki () ;
useEffect ( () => {
const handleAmbientUpdate = ( event ) => {
console . log ( " Ambient event received: " , event ) ;
};
// Subscribe to ambient update events
const unsubscribe = on ( " ambient-update " , handleAmbientUpdate ) ;
// Cleanup subscription on unmount
return () => {
unsubscribe () ;
};
}, [ on ]) ;
return (
<>
Active Ambient ID: { activeAmbientId }
< SukiAssistant
// props
/>
</>
) ;
}
See all 28 lines
Next steps
Refer to the Test mode example to learn how to use the test mode in the web SDK.