tom
09/11/2024, 9:52 AMVapi
09/11/2024, 9:53 AMjsx
import React, { useEffect } from 'react';
const VapiWidget = ({ assistantId }) => {
useEffect(() => {
// Assuming you have the VAPI widget snippet as a function
const loadVapiWidget = () => {
// Your VAPI widget snippet code here
// Make sure to use the `assistantId` in the snippet
};
loadVapiWidget();
}, [assistantId]); // Re-run the effect if the assistantId changes
return <div id="vapi-widget-container"></div>;
};
export default VapiWidget;
To use this component, you would include it in your Framer project like so:
jsx
<VapiWidget assistantId="your-assistant-id" />
Make sure to replace "your-assistant-id"
with the actual assistant ID you get from your Vapi dashboard.
If you need the exact snippet to insert into the loadVapiWidget
function or further assistance, please let me know!Vapi
09/11/2024, 9:53 AMtom
09/11/2024, 10:17 AMShubham Bajaj
09/11/2024, 9:51 PM