Code example
The example below demonstrates how to listen for ambient events in the web SDK.React
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
🚀 New Patient Summary APIs are out! Refer to the Release notes for details.
Listen for ambient session events in the React Web SDK and react to state changes during capture and note generation
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
/>
</>
);
}
Was this page helpful?
Suggestions