Signature Pad save output to server

I am using lemonade.js as signature pad for my webpage The draw event works but I don’t know how to save the output as an image file to my server, via ajax post.

<html>
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@lemonadejs/signature/dist/index.min.js"> 
</script>
<div id="root"></div>
<script>
// Get the element to render signature component inside
const root = document.getElementById("root");
// Call signature with the root element and the options object
Signature(root, {
     value: [],
     width: 400,
     height: 200,
     instructions: "Please sign this document"
 });
 </script>
 </html>