Disabling auto-upload
Thru also supports a version of the web component that allows disabling the auto-upload functionality.
You can trigger the upload with the following code:
<thru-upload api-key="" flow-endpoint-id="1681" api-url="https://exampleurl.thruinc.net/api" auto-upload="false" ></thru-upload> <button onclick="trigger_uploads()">Upload</button> <script> trigger_uploads = () => { const triggerUploadsEvent = new CustomEvent("trigger-uploads") // Trigger the event document.dispatchEvent(triggerUploadsEvent) } </script>
Default functionality is unchanged. You must specify auto-upload="false" for this behavior to be present.