# Embed the PulseSwap widget

One iframe puts the whole PulseSwap swap card on your site — best-rate quotes across every DEX & aggregator it routes through, wallet connect, and the swap itself, without sending your users anywhere. No key, no registration, no rate limit.

## Live demo

The widget on the documentation page is the real thing, loaded from the URL in the snippet below.

## Copy-paste snippet

```html
<iframe
  title="PulseSwap"
  src="https://pulseswap.io/?embed=true&chain=pulsechain&from=0x0000000000000000000000000000000000000000&to=0x95B303987A60C71504D99Aa1b13B4DA07b0790ab"
  width="420"
  height="640"
  style="border:0;border-radius:24px"
  loading="lazy">
</iframe>
```

**Both spellings work.** `embed=yes` and `embed=true` are accepted everywhere — the pre-paint script in `_document.js`, the layout and the `useSwapParams` hook all treat the two identically, so a snippet written either way hides the site chrome _and_ puts the app itself in embed mode.

> **⚠️ Always pass `chain` in a deep link.** Without it the URL normalizer rewrites the query to its default (`chain=pulsechain` plus the native `from`) and your `to` token is **dropped**. The snippet above passes `chain=pulsechain` for exactly that reason — keep it whenever you preselect `from`, `to` or `amount`.

## URL parameters

| Param    |                         | What it does                                                                                                                                                                                                            | Example            |
| -------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `embed`  | required                | Turns on embed mode: hides the site chrome and the SEO block, leaving just the swap card. Accepts `true` or `yes`.                                                                                                      | `embed=true`       |
| `chain`  | required for deep links | Preselects the network. A URL that carries nothing else defaults to `pulsechain` — but it is required whenever you pass `from`, `to` or `amount`, because the normalizer rewrites a chain-less swap URL and drops `to`. | `chain=ethereum`   |
| `from`   | optional                | Sell-token contract address. The zero address selects the chain's native coin.                                                                                                                                          | `from=0x0000…0000` |
| `to`     | optional                | Buy-token contract address.                                                                                                                                                                                             | `to=0x95B3…90ab`   |
| `amount` | optional                | Prefills the sell amount, in whole token units.                                                                                                                                                                         | `amount=1000`      |
| `border` | optional                | `no` drops the card border and its shadow, for a seamless embed on a coloured background.                                                                                                                               | `border=no`        |

Every parameter above is read straight from the live parameter hook — `src/hooks/useSwapParams.tsx` — including the ones the older docs got wrong.

## Theming & sizing

The widget picks its own theme: a stored choice first, otherwise the visitor's system setting, so it lands dark on a dark OS and light on a light one without a parameter. It is responsive down to 320px wide, and 640px of height is the recommended minimum — enough for the amount rows, the route list and the action button without the frame scrolling.

> **Piteas is one of the partners PulseSwap routes through, and its quote API is origin-whitelisted.** It answers requests coming from the pulseswap.io origin, so it works on the live site and inside your embedded widget — a local `curl` or a page opened from `localhost` gets a 403 and simply shows one route fewer. Nothing to configure on your side.

Embedded swaps use the same engine as pulseswap.io: identical rates, and the same 11 DEXes & aggregators on PulseChain.

---

Canonical HTML page: <https://pulseswap.io/docs/embed-swap-widget>
