Get live chat open up using external button

This is my script for the live chat which is embedded in header.php in wordpress environment.

<script src="https://widgets.leadconnectorhq.com/loader.js" 
 data-resources-url="https://widgets.leadconnectorhq.com/chat-widget/loader.js" 
 data-widget-id="668ecb1edad1ad570c3c3c41"></script>

I want to use another div like structure more of a button to have it open and toggle it

I’ve tried adding js to trigger button but failed due to same-origin policy of google