A widget is mapped to a single site. As an example, if you have usefotion.app , you will need to create a widget and install on the website. We have provided a script online for your convenience:

<script src="<https://js.usefotion.app/fotion.js>"></script>

Once the script is installed, you would have access to a Fotion object.

document.addEventListener("DOMContentLoaded", function(event) { 
            const fotion = new Fotion({
                reference: "YOUR_WIDGET_ID",
                email: "[email protected]" // optional, if you have the user email
            })

            const button = document.getElementById('button')
            button.addEventListener('click', function(){
                fotion.open()
            })
        });

You can get your widget ID either by copying the id on the dashboard. Or you can copy it off the url

NextJS

You might need to wrap the Fotion call inside a function like below:

const navItemOnClick = () => {
    const fotion = new Fotion({
      reference: "YOUR_WIDGET_ID",
    })

    fotion.open()
  }