Noah Johnson
10/29/2025, 6:00 PMVapi Support Bot
10/29/2025, 6:02 PMjavascript
// Frontend: fetch dynamic assistant ID from your backend
const getAssistantId = async () => {
const res = await fetch('/api/get-assistant-id');
const { assistantId } = await res.json();
return assistantId;
};
const assistantId = await getAssistantId();
vapi.start(assistantId); // Web SDK streams audio automatically
No need to stream audio from your backend—the Web SDK manages this for you in the browser.
For more, see the [Web Snippet guide](https://docs.vapi.ai/assistants/examples/voice-widget).
Source:
- [Web Snippet guide](https://docs.vapi.ai/assistants/examples/voice-widget)