Add one tag to your page and let people pay with DOGE: a QR code, a wallet link, and an event when the payment arrives.
Live demo · Documentation · All DogeJS projects
- Adds a Pay with DOGE card or button to any page with one script tag and one element.
- Shows a QR code, a
dogecoin:link for any wallet app, and one click in the DogeJS Wallet pop-up (and MyDoge on mainnet, when its extension is installed). - Checks the address and drops a bad one with an error instead of a QR code.
- Can tell your page when a payment arrives, if you point it at an indexer you run or trust.
- Comes with a gallery of button styles (
.svgfiles you can use on their own) and helper functions for Node.
Pick a button, watch a simulated payment arrive and copy the code: https://dogejs.com/pay/
Two lines on your page:
<script src="pay.js" defer></script>
<doge-pay mode="button" address="D..." amount="20" label="Order 1042"></doge-pay>Use a fresh address for each order, and drop network="testnet" for real payments.
The checkout card: an amount, a label, a wallet button and a QR code.
With an indexer set, the window follows the payment: Pay, Confirming, then a green check.
Nothing is on npm yet, so install straight from this repository (it needs a public repository, or a GitHub login that can read it). The prepare script builds dist as part of the install. For a plain page, copy dist/pay.js to your own static host and load it with a script tag. With a bundler, import @dogejs/pay/element once.
npm install github:DogeJS-Dev/pay-button#v0.8.0The helpers run in Node 20 or later without a DOM:
import { validateAddress, buildPaymentUri } from '@dogejs/pay';
const address = 'nUCAGGgZEPN1QyknmQe1oAku817bQAFKFt'; // a testnet address; use your own D... address for real payments
const r = validateAddress(address);
console.log(r.ok, r.network); // true testnet
console.log(buildPaymentUri({ address, amount: '20', label: 'Coffee' })); // dogecoin:nUCAGGgZEPN1QyknmQe1oAku817bQAFKFt?amount=20&label=Coffee<doge-pay> draws the payment window from its attributes (address, amount, label, network, mode, ...). Without the api attribute the window makes no requests and shows no progress. With api set to an Esplora-compatible indexer you run or trust, it watches the address (using backends): Pay, Confirming, then a green check, and your page gets an event. The one-click wallet button opens the DogeJS Wallet in a pop-up and sends the address, amount and label only after the wallet says it is ready; the buyer approves on the wallet's own screen.
Client-side detection is a convenience for showing status. Before you hand over goods of real value, verify the payment on your own server against your own node.
The full reference, with every attribute and event, is in docs/REFERENCE.md.
- Detection uses backends.
- The wallet answers payment requests (protocol:
docs/PAY-REQUEST.mdin that repository). - sign-in is the matching login button, and payment-links and shop-mode are ready-made pages for people who do not want to write code.
Version 0.8.0. It is not published to npm yet, so you install it from git. It has had no external security review. It is tested with jsdom and in a headless browser. Payment detection has only been run against mocks, never against a real Esplora or electrs-doge server, and nothing has been run against the real Dogecoin network. The button artwork's licence and the Dogecoin trademark guidelines still need to be confirmed before wide distribution (see THIRD_PARTY_LICENSES).
Bug reports, ideas and pull requests are welcome. Read the contributing guide first: small, tested, explained.
npm install
npm run build
npm run typecheck
npm testReport a security problem privately to hello@dogejs.com, never in a public issue. See SECURITY.md.
The maintainers keep one combined development workspace for all DogeJS projects and publish each project from it as a repository of its own. An accepted pull request is applied there and appears here with the next release.
MIT, see LICENSE. Bundled third-party code, where there is any, is listed in THIRD_PARTY_LICENSES.



