Minimal steps and copy paste snippets to add the Satisfi popup to any site and call its methods.
Add this inside <head> or just before </body>.
<script id="satisfiScript" src="https://chat.satis.fi/popup/embedder?popupId=YOUR_POPUP_ID"></script>
Replace YOUR_POPUP_ID
with the id provided by Satisfi.
Methods live on window.SatisfiApp.Global
. Call them after the script has loaded.
// opens popup and seeds the composer with a message
SatisfiApp.Global.chatPopupOpen("Who Built This Agent?");
// pass second argument "1" to hide the user input box
SatisfiApp.Global.chatPopupOpen("Who Built This Agent?", "1");
SatisfiApp.Global.chatPopupOpen();
SatisfiApp.Global.chatPopupClose();
SatisfiApp.Global.chatButtonShow();
SatisfiApp.Global.chatButtonHide();
Drop this markup anywhere on your page.
<button onclick="SatisfiApp.Global.chatPopupOpen('Who Built This Agent?')">
Open with default text
</button>
<button onclick="SatisfiApp.Global.chatPopupOpen('Who Built This Agent?', '1')">
Open with hidden input
</button>
<button onclick="SatisfiApp.Global.chatPopupClose()">
Close popup
</button>
Put the default text in the input value
. Read it on click. jQuery is optional.
<input id="q" type="text" value="Who Built This Agent?" />
<button onclick="SatisfiApp.Global.chatPopupOpen(document.getElementById('q').value)">
Ask
</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<input id="q2" type="text" value="Who Built This Agent?" />
<button onclick="SatisfiApp.Global.chatPopupOpen($('#q2').val())">
Ask
</button>