@artidv1/widget
v0.1.0
Published
Embeddable ArtID museum-passport widget — mints ENS subdomain museum sites under artid.eth for any NFT.
Maintainers
Readme
@artidv1/widget
Embeddable widget for ArtID — lets visitors mint ENS museum-passport sites under artid.eth for any NFT they own.
Drop-in <script> tag
<script
src="https://unpkg.com/@artidv1/widget/dist/widget.js"
data-collection="0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
defer
></script>Optional attributes: data-token-id, data-label, data-host.
Place a button anywhere with a placeholder:
<div data-artid-widget data-collection="0x..." data-token-id="123"></div>Programmatic API
import { open, close, mount } from "@artidv1/widget";
open({ collection: "0x...", tokenId: "123" });
mount(document.getElementById("slot"), { collection: "0x..." });Events
window.addEventListener("artid:registered", (e) => {
console.log(e.detail); // { subdomain, slug, txHash, cid }
});Self-host
The CDN script is dist/widget.js (IIFE, ~3 KB min). You can host it on your own domain — just pass data-host="https://your-artid-host" if you've forked the dApp too.
License: MIT.
