HASH PAY CDN
cdn.hashpay.dev · the payment widget

The HashPay payment widget.

One <script>, one button — a non-custodial stablecoin checkout you can drop on any website. Buyers pay USDC/USDT across 8 chains; funds settle straight to your wallet. HashPay never holds keys or funds.

What is this?

cdn.hashpay.dev is the home of HashPay's embeddable checkout.

embed.js is a single, self-contained script (it inlines its own styles into a Shadow DOM, so it can't clash with — or be broken by — your site's CSS). You reference one of your Prices by id, and the widget pops an overlay checkout: the buyer picks a chain and token, sees the exact amount and a QR, and pays. HashPay watches the chain and confirms the payment in real time.

Non-custodial

Your wallet, always

Money moves buyer → your wallet directly. HashPay never touches funds or keys.

Amount-safe

Server-set price

The amount lives on the server against your Price — never in the buyer's browser.

8 chains

USDC & USDT

Solana, Tron, Ethereum, Base, Arbitrum, Polygon, Avalanche, BNB Chain.

Isolated

Shadow-DOM widget

Styles are inlined & scoped — no leakage either way, drops onto any stack.

Add it in two lines

Paste the script once, then a button referencing one of your Prices.

Embed snippet
<!-- 1. Load the widget once (anywhere on the page) -->
<script src="https://cdn.hashpay.dev/embed.js" data-pk="pk_live_your_publishable_key"></script>

<!-- 2. Any button that references a Price opens the checkout -->
<button data-hashpay-price="price_123abc">Pay with crypto</button>

That's it. data-pk is your publishable key (safe in the browser). Buttons with data-hashpay-price, data-hashpay-link, or data-hashpay-session are wired automatically.

Prefer to open it from your own code?

HashPay.checkout()
<script src="https://cdn.hashpay.dev/embed.js"></script>
<script>
  HashPay.checkout({
    priceId: "price_123abc",
    publishableKey: "pk_live_your_publishable_key",
    metadata: { orderId: "order-42" },  // echoed back in your webhook
    onClose: () => console.log("checkout closed")
  })
</script>
🔑
You need a publishable key and at least one Price. Create them in the dashboard at app.hashpay.dev → Products & prices → Developers. Use a pk_test_… key while integrating (test payments settle with a "Simulate" button, no crypto), then switch to pk_live_….

How it works

  1. The buyer clicks your button; the widget asks the server for the Price's amount and the chains/tokens you accept (it never trusts an amount from the page).
  2. They pick a chain + token and get the exact amount + a unique address (matched by amount, no memos).
  3. They send the stablecoin from any wallet; HashPay watches the chain and flips the widget to confirmed the moment it lands — and fires you a signed webhook.
  4. Funds are already in your wallet. HashPay was never in the path.

Reference

The global is window.HashPay, exposed by embed.js.

Declarative attributes

AttributeOnMeaning
data-pkthe <script>Default publishable key for the page.
data-hashpay-pricea buttonOpen checkout for a Price id.
data-hashpay-linka buttonOpen checkout for a Payment Link id.
data-hashpay-sessiona buttonOpen checkout for a server-created Checkout Session.
data-hashpay-pka buttonOverride the publishable key for that button.
data-hashpay-metaa buttonJSON metadata echoed back in your webhook — pass your order id here.
data-hashpay-modea button"inline" renders in-page instead of the modal overlay.
data-hashpay-containera buttonElement id to render into (required with data-hashpay-mode="inline").

HashPay.checkout(options)

OptionTypeNotes
priceId / paymentLinkId / sessionIdstringExactly one — what the buyer is paying for.
publishableKeystringYour pk_… key. Falls back to the script's data-pk.
metadataobjectYour own context (order id, customer id…), echoed back unchanged in the payment webhook. Pass it so your webhook consumer can find its order.
modestring"modal" (default) or "inline" — inline flows inside your page, no overlay.
containerstringElement id to render into. Required when mode is "inline".
apiBasestringOptional. Defaults to the script's origin + /api/v1.
onClosefunctionCalled when the buyer dismisses the checkout.

See it live →   Get your keys →