{"id":3578,"date":"2025-11-07T23:10:50","date_gmt":"2025-11-07T22:10:50","guid":{"rendered":"https:\/\/blog.tomayac.com\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/"},"modified":"2025-11-07T23:10:50","modified_gmt":"2025-11-07T22:10:50","slug":"using-the-web-monetization-api-for-fun-and-profit","status":"publish","type":"post","link":"https:\/\/tomayac.com\/wordpress\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/","title":{"rendered":"Using the Web Monetization API for fun and profit"},"content":{"rendered":"\n\t\t\t<p>I recently <a href=\"https:\/\/jsconfmx.org\/speaker\/W3Eio\">spoke at JSConf Mexico<\/a>, where\nspent a lot of time with the <a href=\"https:\/\/interledger.org\/\">Interledger Foundation<\/a>\nfolks in the hallway track and at the after party events, namely with\n<a href=\"https:\/\/www.linkedin.com\/in\/ioanachiorean\/\">Ioana<\/a> (Eningeering Manager) and\n<a href=\"https:\/\/www.linkedin.com\/in\/marianvilla\/\">Marian<\/a> (DevRel) to talk about\n<a href=\"https:\/\/webmonetization.org\/\">Web Monetization<\/a>.<\/p>\n<blockquote>\n<p>Web Monetization gives publishers more revenue options and audiences more ways\nto sustain the content they love. Support can take many forms: from a one-time\ncontribution to a continuous, pay-as-you-browse model. It all flows seamlessly\nwhile people engage with the content they love. Publishers earn the moment\nsomeone engages, while audiences contribute in real time, using a balance they\ncontrol.<\/p>\n<\/blockquote>\n<p>I encourage you all to give it a try! Install the\n<a href=\"https:\/\/chromewebstore.google.com\/detail\/web-monetization\/oiabcfomehhigdepbbclppomkhlknpii\">extension<\/a>\nthat polyfills the proposed Web standard, get a wallet (I went with\n<a href=\"https:\/\/gatehub.net\/\">GateHub<\/a>, which works in US Dollars and Euros), and then\nconnect it to the extension.<\/p>\n<p>You need to have funds in EUR (\u20ac) or USD ($). If you have crypto, it won't work,\nwhich I've found out by trial and error, as I was part of\n<a href=\"https:\/\/coil.com\/\">Coil<\/a>, the Web Monetization predecessor, which paid out in\nXRP.<\/p>\n<p>Just to clarify, while you need a wallet\u2014that typically is used for crypto\u2014the\nactual transactions are all in real fiat money, Euro in my case.<\/p>\n<h2 id=\"as-an-extension-user\" tabindex=\"-1\">As an extension user <a class=\"direct-link\" href=\"https:\/\/blog.tomayac.com\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/#as-an-extension-user\" aria-hidden=\"true\">\ud83d\udd17<\/a><\/h2>\n<p>Connect your wallet, and browse to a page that supports Web Monetization. You\nwill notice whether a page is monetized when the extension has a green\ncheckmark. My blog happens to be monetized.<\/p>\n<p><img src=\"https:\/\/blog.tomayac.com\/images\/web-monetization-extension.png\" alt=\"The Web Monetization extensions's popup window.\" \/><\/p>\n<p>You can adjust how much you want to pay the site per hour and also send one-time\npayments. The money is &quot;streamed&quot; every minute, which you can observe in\nDevTools.<\/p>\n<p><img src=\"https:\/\/blog.tomayac.com\/images\/web-monetization-post-request.png\" alt=\"Chrome DevTools Network tab showing a POST request for a payment.\" \/><\/p>\n<p>We actually have\n<a href=\"https:\/\/groups.google.com\/a\/chromium.org\/d\/msgid\/blink-dev\/d91487a5-108c-46e7-accd-d44b734a0b34%40igalia.com\">code in Chromium<\/a>\nto make native Web Monetization happen, implemented by Igalia and funded by the\nInterledger Foundation. I hope they can share the experiment results soon.<\/p>\n<h2 id=\"as-a-publisher\" tabindex=\"-1\">As a publisher <a class=\"direct-link\" href=\"https:\/\/blog.tomayac.com\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/#as-a-publisher\" aria-hidden=\"true\">\ud83d\udd17<\/a><\/h2>\n<p>On your page, add a\n<a href=\"https:\/\/webmonetization.org\/developers\/link-element\/\">payment link<\/a>. You get\nthe personalized payment pointer from your wallet. The following snippet shows\nmine.<\/p>\n<pre class=\"language-html\"><code class=\"language-html\"><span class=\"token tag\"><span class=\"token tag\"><span class=\"token punctuation\">&lt;<\/span>link<\/span> <span class=\"token attr-name\">rel<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=<\/span><span class=\"token punctuation\">\"<\/span>monetization<span class=\"token punctuation\">\"<\/span><\/span> <span class=\"token attr-name\">href<\/span><span class=\"token attr-value\"><span class=\"token punctuation attr-equals\">=<\/span><span class=\"token punctuation\">\"<\/span>https:\/\/ilp.gatehub.net\/348218105\/eur<span class=\"token punctuation\">\"<\/span><\/span> <span class=\"token punctuation\">\/><\/span><\/span><\/code><\/pre>\n<p>Then you're ready to receive payments. Here's me browsing my blog and seeing\npayments go out from and come in to my GateHub wallet. This is of course\neffectively a zero sum game, me paying myself. The 0.01 cent are the streamed\npayments that go out and then come in again. I tested a one-time payment as\nwell. The 0.50 cents (not shown) was a successful one-time payment.<\/p>\n<p><img src=\"https:\/\/blog.tomayac.com\/images\/web-monetization-wallet.png\" alt=\"The GateHub wallet showing incoming and outgoing transactions.\" \/><\/p>\n<p>There's also a\n<a href=\"https:\/\/webmonetization.org\/developers\/interfaces\/\">JavaScript API<\/a>, so you can\nadjust the content of your page when your page notices that the user is paying.<\/p>\n<pre class=\"language-js\"><code class=\"language-js\">window<span class=\"token punctuation\">.<\/span><span class=\"token function\">addEventListener<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'monetization'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token parameter\">event<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">=><\/span> <span class=\"token punctuation\">{<\/span>\n  <span class=\"token keyword\">const<\/span> <span class=\"token punctuation\">{<\/span> value<span class=\"token punctuation\">,<\/span> currency <span class=\"token punctuation\">}<\/span> <span class=\"token operator\">=<\/span> event<span class=\"token punctuation\">.<\/span>amountSent<span class=\"token punctuation\">;<\/span>\n  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token template-string\"><span class=\"token template-punctuation string\">`<\/span><span class=\"token string\">Browser sent <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>currency<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\"> <\/span><span class=\"token interpolation\"><span class=\"token interpolation-punctuation punctuation\">${<\/span>value<span class=\"token interpolation-punctuation punctuation\">}<\/span><\/span><span class=\"token string\">.<\/span><span class=\"token template-punctuation string\">`<\/span><\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n  <span class=\"token keyword\">const<\/span> linkElem <span class=\"token operator\">=<\/span> event<span class=\"token punctuation\">.<\/span>target<span class=\"token punctuation\">;<\/span>\n  console<span class=\"token punctuation\">.<\/span><span class=\"token function\">log<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">'for link element:'<\/span><span class=\"token punctuation\">,<\/span> linkElem<span class=\"token punctuation\">,<\/span> linkElem<span class=\"token punctuation\">.<\/span>href<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/code><\/pre>\n<p>For testing purposes, you can observe these <code>monetization<\/code> events in Chrome\nDevTools by pasting in the snippet above in the Console.<\/p>\n<p><img src=\"https:\/\/blog.tomayac.com\/images\/web-monetization-devtools.png\" alt=\"Chrome DevTools Console showing a  event.\" \/><\/p>\n<p>This way you could, for example, remove ads, or unlock an article when you\nnotice a one-time payment. On my blog, I just show a &quot;thank you&quot; message for\nnow.<\/p>\n<p><img src=\"https:\/\/blog.tomayac.com\/images\/web-monetization-thank-you.png\" alt=\"Thank you message in the footer of my blog showing how much the user has paid.\" \/><\/p>\n<p>I'm really bulli$h on this proposed standard. Hopefully someone else will try it\nand let me know how it goes. I truly and honestly believe that this could be the\nfuture for making the Web of tomorrow financially sustainable for publishers,\nbig and small.<\/p>\n\n\t\t\t<p>\n\t\t\t\t<img alt=\"Thomas Steiner\" width=\"32\" height=\"32\" src=\"https:\/\/blog.tomayac.com\/feed.php?dl=https%3A%2F%2Fblog.tomayac.com%2F2025%2F11%2F07%2Fusing-the-web-monetization-api-for-fun-and-profit%2F&dp=%2F2025%2F11%2F07%2Fusing-the-web-monetization-api-for-fun-and-profit%2F&dt=Using%20the%20Web%20Monetization%20API%20for%20fun%20and%20profit\" alt=\"\">\n\t\t\t\t<br\/>This post appeared first on <a href=\"https:\/\/blog.tomayac.com\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/\">https:\/\/blog.tomayac.com\/2025\/11\/07\/using-the-web-monetization-api-for-fun-and-profit\/<\/a>.\n\t\t\t<\/p>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\t\t\tI recently spoke at JSConf Mexico, where<br \/>\nspent a lot of time with the Interledger Foundation<br \/>\nfolks in the hallway track and at the after party events, namely with<br \/>\nIoana (Eningeering Manager) and<br \/>\nMarian (DevRel) to talk about<br \/>\nWeb Monetization.<\/p>\n<p>Web &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"intlwemo_wallet_address":"","footnotes":""},"categories":[],"tags":[],"class_list":["post-3578","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3578"}],"version-history":[{"count":4,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3578\/revisions"}],"predecessor-version":[{"id":3588,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/posts\/3578\/revisions\/3588"}],"wp:attachment":[{"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tomayac.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}