Embed guide

Put any of the six tools on your own website with one line: the script tag, every attribute, and how the wallet pop-up works.

Each tool is reachable at /embed/<tool>/<token address>. The loader at /embed.js adds a responsive iframe where its tag sits, takes your colors, and resizes the frame to fit what is inside.

The script tag

HTML
<script src="https://iamnowutility.com/embed.js"
        data-widget="stats"
        data-mint="YOUR_TOKEN_ADDRESS"
        async></script>

Use one tag per widget. The Studio writes this line for you, with your token address and your colors.

Attributes

AttributeValuesWhat it does
data-widgetbuy, trust, burn, locks, split, statsWhich tool to show. Required.
data-mintA token addressThe token the tool is for. Required.
data-accentA hex color such as ff9f0aThe accent color for buttons and highlights.
data-bgnight, graphite, ink, ocean, forest, plum, ember, wine, a hex color or transparentThe background. A tone that is too light for our text falls back to night.
data-radiussharp, soft, roundThe corner style.
data-compact1A tighter layout.
data-widthA CSS length, such as 100% or 480pxThe width of the frame. Default 100%.
data-max-widthA CSS lengthA maximum width.
data-heightA number of pixels from 40 to 4000The first height, before the widget reports its own.
data-targetA CSS selectorWhere to put the frame. Default: right after the tag.

Sizes

ToolStarting heightCompact
Buy Button450 px320 px
Trust Badge1800 px60 px
Burn Wall790 px580 px
Lock Proof400 px380 px
Locked Split270 px220 px
Live Stats560 px170 px

The frame resizes itself once the widget has loaded. These are only the first heights.

Single page apps

JavaScript
window.InuEmbed.mount(document.getElementById("slot"), {
  widget: "buy",
  mint: "YOUR_TOKEN_ADDRESS",
  accent: "63e6be",
  compact: true,
});

It gives back the iframe, or null when an option is not valid. Errors are logged to the console as warnings and never thrown.

A plain iframe

HTML
<iframe src="https://iamnowutility.com/embed/stats/YOUR_TOKEN_ADDRESS"
        style="width:100%;border:0;color-scheme:dark"
        sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-forms"
        loading="lazy"></iframe>

It works the same, without automatic resizing. The theme goes in the address as ?accent=, &bg=, &radius= and &compact=1.

Wallets and the pop-up

An embed never connects a wallet inside its frame. Wallet extensions cannot be relied on inside another site's iframe, and Phantom's own documentation says it does not inject its provider into iframes. So an embed shows information, and every action opens a pop-up on our own site.

  1. A visitor taps a button

    The embed opens /act/<tool>/<token address> in a small window, as part of the tap, so browsers allow it.

  2. The pop-up is a normal page of ours

    Every wallet works there. It shows our domain, the token and where it was started from, then asks the wallet to sign.

  3. The result goes back

    The pop-up reports the result to the embed, and closes itself a moment after a success. If the visitor closes it first, the embed treats it as cancelled.

  4. The chain has the last word

    If a strict browser policy cuts the link back, or a phone switches apps, the embed reads the chain again to see what happened.

Safety

  • The iframe is sandboxed. It can run scripts and open pop-ups, and it cannot navigate your page.
  • The loader reads nothing from your page except its own tag and your page's origin, which it passes along so the pop-up can say where it was opened from.
  • The loader only ever loads the site it came from, and it checks every value before it reaches the address or the style.
  • A resize message is accepted only from the loader's own frame and from our origin, and only for heights from 40 to 4000 px.
  • Only the embed paths on our site can be framed. Every other page of ours refuses framing.