Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Embed a commit button in 5 minutes · Boson Protocol
Skip to content

Embed a commit button in 5 minutes

What you'll build: a working "Buy now" button on an existing webpage that triggers the Boson commit flow. No SDK, no React, no build step.

Time: 5 minutes. Stack: any HTML page. Network: staging (Base Sepolia) by default.

1. Find your seller ID and product UUID

If you already have a seller account, look up your sellerId and the productUuid of the offer you want to sell — for example via the Boson dApp or via:

const offers = await sdk.getOffers({ where: { seller: yourAddress } })

If you don't yet have a seller account, do Quickstart → Build a marketplace first, or use a public test seller / product (see staging seed data in the agent-builder repo).

2. Drop in the HTML

<!doctype html>
<html>
<head>
  <title>My drop</title>
  <script src="https://widgets.bosonprotocol.io/scripts/boson-widgets.js" async></script>
</head>
<body>
  <h1>Buy my thing</h1>
 
  <button
    id="boson-commit"
    data-config-id="staging-84532-0"
    data-seller-id="2"
    data-product-uuid="ec00f1a5-2c96-4d22-9d80-2a7c12345678">
    Buy now
  </button>
</body>
</html>

That's it. Open the page; click "Buy now"; the widget opens a modal that:

  1. Asks the buyer to connect a wallet.
  2. Shows the offer details and price.
  3. Walks them through approval (if ERC-20) and commit.
  4. Returns a voucher (rNFT) to their wallet.

Production switch

Swap staging-84532-0 for production-137-0 (Polygon mainnet) or any other production ConfigId. Full list at Networks → ConfigIds matrix.

Common gotchas

  • Wrong network. The buyer's wallet must be on the chain that matches configId. The widget prompts them to switch.
  • Insufficient gas / token balance. The widget surfaces the error inline; nothing breaks server-side.
  • CSP blocks. If your site has a strict Content Security Policy, allow https://widgets.bosonprotocol.io for scripts and frames.

What this doesn't do

Next