How to launch a Landbot by clicking a button

To trigger and open bot that is embedded as a LiveChat or Pop up mode here is an example of the code you need:

<html> 
<body>
<button onclick="myLandbot.open()">Open bot</button>
<script src="https://static.landbot.io/landbot-widget/landbot-widget-1.0.0.js">
</script>
<script>
var myLandbot = new LandbotLivechat({
index: 'your bot url'
});
</script>
</body>
</html>


How did we do?