Skip to main content

HTML / vanilla JS

The simplest possible integration. Drop into any HTML page:

index.html
<!-- Load the SDK -->
<script src="https://pay.helamesh.com/sdk/v1.js"></script>

<!-- Where the checkout will render -->
<div id="helamesh-checkout"></div>

<script>
HelaMesh.mount('#helamesh-checkout', {
invoiceId: 'YOUR_INVOICE_ID',
publishableKey: 'pk_test_YOUR_KEY',
onPaid: (event) => {
console.log('Payment received', event.invoice);
window.location.href = '/order/success';
},
onExpired: () => {
alert('Payment window expired. Please try again.');
},
});
</script>

You only need three things on the page: the script tag, a div with an id, and the mount call. The SDK handles the iframe, polling, auto-resize, and lifecycle events.