This demo showcases the core features of the @d-id/client-sdk with Vite and vanilla JavaScript. It’s meant as a starting point for your own customizations, demonstrating the SDK’s basic functionality in a simple, approachable way — not as a production-ready application.
- Real-time video and audio streaming with D-ID Agents
- Chat and Speak modes (Chat: D-ID’s LLM responses, Speak: repeats textbox input for custom implementations)
- New: Fluent streaming + response interruption (Agents with V3 Pro Avatars only)
- Speech-to-text example using the open-source WebSpeech API
- Modern UI with responsive design
git clone https://github.com/de-id/agents-sdk-demo.git
cd agents-sdk-demo-mainnpm installindex.html— Main HTML filemain.js— Application logic and D-ID SDK integrationwebSpeechAPI.js— WebSpeech API Speech-to-text supportstyle.css— Stylingpackage.json— Project configuration
The package.json includes the following scripts:
"scripts": {
"dev": "vite --port 3000",
"build": "vite build",
"preview": "vite preview"
}npm run dev— Start the development server on http://localhost:3000npm run build— Build for productionnpm run preview— Preview the production build
-
Fetch your
data-client-keyanddata-agent-idfrom the D-ID Studio or API (see the Agents SDK Overview). -
Paste them at the top of
main.js:let auth = { type: 'key', clientKey: "<your-client-key>" }; let agentId = "<your-agent-id>";
npm run devThen open http://localhost:3000 in your browser.
- Requires Node.js v20.19.0 or v22+
- For more information, see the D-ID Agents SDK documentation.
© D-ID. MIT License.