Skip to main content
The SDK is a container and an event relay. It does not render card input, read card data, or reach into the provider’s content. Capture happens on the provider’s PCI surface.

Install

Use it with a bundler — the SDK is bundled into your app.

Create the order on your backend

The order comes from your server, never from the browser. Your API key stays server-side. See Cards or Apple Pay for the request.

Mount the order

Check Meld.capabilities(order).embeddable first if you handle order types this SDK does not embed.

Events

The five events covers what each one means, and how onCancel and onError relate to the status.

Tear down

Unmount on onPaymentSubmitted, on onCancel, and when you navigate away. Leaving a mounted surface behind holds provider resources open, and leaves the user sitting on the provider’s post-submit screen.

Content Security Policy

If your page sets a CSP, ask the SDK what the providers need rather than hard-coding hosts:
The result is read from the SDK’s provider registry and reflects the environment set in Meld.configure, so there is nothing provider-specific for you to maintain. Providers whose KYC runs inside the surface need camera in iframeAllow.

Settlement

Settlement is your webhook. onPaymentSubmitted and a completed status change are both UX signals: unmount and show a pending state, never credit a user. See Configure webhooks.