Benny B
10/08/2025, 1:48 PMChiranjeet Mishra
10/11/2025, 12:27 AMhtml
<script src="https://cdn.vapi.ai/widget.js"></script>
- If you're using React, install the package:
bash
npm install @vapi-ai/client-sdk-react
Then include the component:
tsx
import { VapiWidget } from '@vapi-ai/client-sdk-react';
function App() {
return <VapiWidget public-key="YOUR_PUBLIC_API_KEY" assistant-id="YOUR_ASSISTANT_ID" />;
}
3. **Configure Modes**:
- For voice mode:
html
<vapi-widget mode="voice"></vapi-widget>
- For chat mode:
html
<vapi-widget mode="chat"></vapi-widget>
4. **Customize Appearance**:
- Adjust styles directly in the widget configuration:
html
<vapi-widget theme="dark" position="bottom-right" />
To find more details, refer to the [Web Widget Documentation](https://docs.vapi.ai/chat/web-widget). If you encounter styling conflicts, ensure your site's CSS does not override the widget's styles, or use the !important rule selectively within your CSS.