This project allows website developers to easily implement a way for users to contact their company.
Under the hood, it uses NextJS for the frontend which is then wrapped by an iframe element and
placed in the website's DOM. The developer can communicate with the iframe by using the API
provided in the widget.js file.
- Add the
widget.jsfile to your website. - Implement the
onCallWidgetReadyfunction.- This function passes a new
CallWidgetobject in the parameter.
- This function passes a new
- Store the object in a variable and initialize the widget.
There is an example provided here.
Called by widget.js when it is ready to be initialized.
widget:CallWidget A new CallWidget object that you can use to control the widget.
Creates the iframe and overlay elements and adds them to the DOM.
title:string The text to be used in the title text element of the widget.
buttonText:string The text to be used in the button to initiate a call.
Sets the display style of the widget to block.
Sets the display style of the widget to none.