The result
The Code
You can choose between those two options :
- Just add our JS widget ("https://embed.myinterview.com/widget/2.30.0/widget.js") at the end of the HTML page and initialize it with the parameters.
Then add the following component into your React app :JavaScriptjavascriptCopy
class MyInterviewWidget extends React.Component { render() { return <form> <div id="myinterview-widget"> </div> </form>; } }
-
You can also directly integrate the embed of the widget JS using the following component :
JavaScript
javascriptCopy
class MyInterviewWidget extends React.Component { componentDidMount() { const script = document.createElement("script"); script.src = "https://embed.myinterview.com/widget/2.30.0/widget.js"; script.async = true; script.defer = true; document.body.appendChild(script); script.onload = () => { var myInterviewRecorder = new myInterviewWidget({ container: '#mycustom-container', // querySelector to the element that will contain the widget config: { apiKey: "TCeni10RVWO0jEJHN3uF" } }); } } render() { return <form> <div id="mycustom-container"> </div> </form>; } }