<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>The Interledger Community 🌱: Ciaran</title>
    <description>The latest articles on The Interledger Community 🌱 by Ciaran (@ciaran).</description>
    <link>https://community.interledger.org/ciaran</link>
    <image>
      <url>https://community.interledger.org/images/vsualKWXcGab0SKSwVxOjbjGIbV4sLp-MowQGREvxLE/rs:fill:90:90/g:sm/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL3VzZXIv/cHJvZmlsZV9pbWFn/ZS81MDkvYTUyMjlj/M2MtYzhhNi00NDBk/LTliYzEtNDM3NDQx/MDE5NDhjLmpwZWc</url>
      <title>The Interledger Community 🌱: Ciaran</title>
      <link>https://community.interledger.org/ciaran</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://community.interledger.org/feed/ciaran"/>
    <language>en</language>
    <item>
      <title>Interruptor — Grant Report #2 (Final)</title>
      <dc:creator>Ciaran</dc:creator>
      <pubDate>Sun, 27 Mar 2022 21:34:11 +0000</pubDate>
      <link>https://community.interledger.org/interruptor/interruptor-grant-report-2-final-13mh</link>
      <guid>https://community.interledger.org/interruptor/interruptor-grant-report-2-final-13mh</guid>
      <description>&lt;h2&gt;
  
  
  Project Update
&lt;/h2&gt;

&lt;p&gt;We've reached the end of the grant period, and we're happy to say that we've managed to achieve all of our main objectives.&lt;/p&gt;

&lt;p&gt;In terms of technical implementation, things went fairly smoothly. All of the bonus features we planned for Web Monetization users were implemented, and the last couple of months were spent refining them.&lt;/p&gt;

&lt;p&gt;As for our community intiatives, it was great to have fellow grantee Kult at our last event, where we talked about what Web Monetization is, how to implement it, how it can help creators monetize their work.&lt;/p&gt;

&lt;p&gt;While things have gone well tech-wise and there seems to be interest from the community about Web Monetization, we're still facing a couple of challenges.&lt;/p&gt;

&lt;p&gt;The first issue is to do with the wallet/payment provider. Our account was frozen early on in the grant period, and it took several months to get answers from them about what we needed to do to get our account working again. This means that for the majority of the time, we have not been receiving payments from Web Monetization users, and it's unclear whether we'll receive any payments that were sent during this time once the account is working again. Last week we emailed the extra documentation the provider asked for, so hopefully things will progress on this front soon.&lt;/p&gt;

&lt;p&gt;The second challenge we have is the slow uptake from our audience to start using Coil/Web Monetization. According to our analytics, over the last six months only 0.1% of visitors had Web Monetization enabled. We feel that our users might be a bit hesitant to sign up for a Coil membership because of language and currency barriers: the site is only available in English and payments need to be made in USD. It could also be that we're the only (or one of the only) media outlets in Portugal that uses Web Monetization, and if we can get other groups to implement it, it'll become a more "normal" option for our users.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress on objectives
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bonus features for users
&lt;/h3&gt;

&lt;p&gt;We've implemented all of our planned bonus features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bonus fonts&lt;/li&gt;
&lt;li&gt;Bonus themes&lt;/li&gt;
&lt;li&gt;Audio player for audio versions articles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the implementation needed tweaking a bit (we realised we were spamming users with thank-you messages whenever they changed page), but it's fair to say that things went fairly smoothly, helped greatly by the fact that the Web Monetization API is so easy to work with.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open-source
&lt;/h3&gt;

&lt;p&gt;As mentioned in our last report, we released a small package on npm for using Web Monetization in React: &lt;a href="https://www.npmjs.com/package/@interruptor/react-monetization"&gt;@interruptor/react-monetization&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key activities
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The second community event: Overview of Web Moneitzation and Our Experience
&lt;/h3&gt;

&lt;p&gt;This event was originally going to be two separate events - one for giving an overview of Web Monetization at Interruptor and a second for talking about our experience - but we combined them due to time, and also because it seemed natural to not only give an intro to Web Monetization but to give a more in-depth explanation of our experience. Together with &lt;a class="mentioned-user" href="https://community.webmonetization.org/patrickrahy"&gt;@patrickrahy&lt;/a&gt; from Kult, we were able to cover what Web Monetization is, how we've implemented it and what we've learned along the way.&lt;br&gt;
Due to Covid, the event was live streamed on YouTube, which you can see here (in Portuguese): &lt;a href="https://www.youtube.com/watch?v=SMbgqXLXBSU"&gt;https://www.youtube.com/watch?v=SMbgqXLXBSU&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Communications and marketing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The tech blog
&lt;/h3&gt;

&lt;p&gt;Over the last six months, we've released a number of posts about Web Monetization on &lt;a href="https://tech.interruptor.pt/en"&gt;our new tech blog&lt;/a&gt; (available in English and Portuguese), which includes a couple of tutorials on how to get started with Web Monetization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tech.interruptor.pt/en/blog/web-monetization-part-one-setup"&gt;Web Monetization: Part 1 - Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tech.interruptor.pt/en/blog/web-monetization-part-one-setup"&gt;Web Monetization: Part 2 - Checking it's active&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The code for the blog is also available under an MIT license here: &lt;a href="https://github.com/InterruptorPt/tech-blog"&gt;https://github.com/InterruptorPt/tech-blog&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next?
&lt;/h2&gt;

&lt;p&gt;Given the slow uptake of Web Monetization users on our site, we're going to think about some ways to make it more visible as a way to support us - maybe by having a section on the homepage about it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What community support would benefit your project?
&lt;/h2&gt;

&lt;p&gt;We'd be curious to know whether other grantees from outside the US/from non-English-speaking countries had issues with payment providers and/or getting users on board, and whether they have any tips.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Despite the issues we've faced, we're happy with how the grant period has gone, and we're excited to see where Web Monetization could take the us - and the web as a whole - in the future. The privacy-friendly nature of Web Monetization fits right in with our values at Interruptor, and it's great that our users have a way to support us without us needing any personal or financial information and without us needing to build the infrastructure to handle that. The grant has given us the chance to work on some features that we probably wouldn't have done otherwise, and we're now able to reward users who support us, which is awesome. 🎉&lt;/p&gt;

</description>
      <category>grantreports</category>
    </item>
    <item>
      <title>Interruptor — Grant Report #1</title>
      <dc:creator>Ciaran</dc:creator>
      <pubDate>Wed, 22 Dec 2021 14:11:23 +0000</pubDate>
      <link>https://community.interledger.org/interruptor/interruptor-grant-report-1-md3</link>
      <guid>https://community.interledger.org/interruptor/interruptor-grant-report-1-md3</guid>
      <description>&lt;h2&gt;
  
  
  Project Update
&lt;/h2&gt;

&lt;p&gt;While we were held back initially by some classically difficult Portuguese bureaucracy, we're making good progress with our project, especially tech-wise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Progress on objectives
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Bonuses for web-monetization users
&lt;/h3&gt;

&lt;p&gt;Something that's important to us at Interruptor is that we don't block content behind a paywall, so we're instead providing bonus features to people who support us by using web monetization.&lt;/p&gt;

&lt;h4&gt;
  
  
  Extra colour themes
&lt;/h4&gt;

&lt;p&gt;The site previously only had a light and dark mode, but it now has a few extra themes: a "peach" theme, and two black-and-white themes (light and dark).&lt;/p&gt;

&lt;h4&gt;
  
  
  A font selector
&lt;/h4&gt;

&lt;p&gt;We chose the font used on the website for the main body text carefully, but it is a matter of taste. We added extra font options so that, in case you prefer something a little bit different.&lt;/p&gt;

&lt;h4&gt;
  
  
  An audio player for articles
&lt;/h4&gt;

&lt;p&gt;As an extra-special bonus, we want to offer audio versions of articles. The audio player is implemented and ready to go - all that's left is to do some recordings. We're not planning to have an audio version of &lt;em&gt;every&lt;/em&gt; article, so maybe we'll need to do something to highlight which articles do have it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open-source
&lt;/h3&gt;

&lt;p&gt;Our website is built with React, and after implementing the functionality for checking whether Web Monetization is active and updating the UI accordingly, we were able to extract the logic into a small package and published it on npm: &lt;a href="https://www.npmjs.com/package/@interruptor/react-monetization"&gt;&lt;code&gt;@interruptor/react-monetization&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
The logic is so simple that we're considering creating packages for other frontend frameworks, such as Svelte and Vue.&lt;/p&gt;

&lt;h3&gt;
  
  
  Knowledge sharing
&lt;/h3&gt;

&lt;p&gt;As part of the initiative, we created a tech blog following how we set things up on our website and the work we've been doing on developing the extra features. You can find our blog and articles here: &lt;a href="https://tech.interruptor.pt"&gt;https://tech.interruptor.pt&lt;/a&gt; (available in English and Portuguese).&lt;/p&gt;

&lt;p&gt;We have also organized the first of three events for small and alternative media on November 17th 2021 - details below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key activities
&lt;/h2&gt;

&lt;h3&gt;
  
  
  First small media event
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;When:&lt;/strong&gt; 17th november 2021&lt;br&gt;
&lt;strong&gt;Where:&lt;/strong&gt; Central Gerador&lt;/p&gt;

&lt;p&gt;Our first event was focused on open licencing models. There were two presentations from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Teresa Nobre - Lawyer; she has been working closely on the European copyright reform as part of Communia. She is the legal coordinator of the Portuguese chapter of Creative Commons. She did a presentation on the basics of Creative Commons and the legal aspects under the Portuguese context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ana Isabel Carvalho and Ricardo Lafuente from &lt;a href="https://manufacturaindependente.org/"&gt;Manufactura Independente&lt;/a&gt; - Ana and Ricardo founded the design studio Manufactura Indepedente in 2010, based on the ideals of free software and free culture. Since then, they have created and published works openly. They shared their experience with the CC licences as well as with collaborative creation. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/kBqao5ZQqEc6nqKrMyO-nhm0Tpa4F4f0xd4qqFA_m0U/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL2FydGlj/bGVzL2lvMW8wNjE5/YWY3YjhkeGZuaGJu/LmpwZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/kBqao5ZQqEc6nqKrMyO-nhm0Tpa4F4f0xd4qqFA_m0U/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL2FydGlj/bGVzL2lvMW8wNjE5/YWY3YjhkeGZuaGJu/LmpwZw" alt="Teresa Nobre giving her presentation" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.interledger.org/images/hV3VQElE0beLvex0_u2IW9guexYXhqNLqwWOxIHWEpo/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL2FydGlj/bGVzL3hqdDZ4NWph/eHB4cnpqdzBoZm15/LmpwZw" class="article-body-image-wrapper"&gt;&lt;img src="https://community.interledger.org/images/hV3VQElE0beLvex0_u2IW9guexYXhqNLqwWOxIHWEpo/w:880/mb:500000/ar:1/aHR0cHM6Ly9jb21t/dW5pdHkuaW50ZXJs/ZWRnZXIub3JnL3Jl/bW90ZWltYWdlcy91/cGxvYWRzL2FydGlj/bGVzL3hqdDZ4NWph/eHB4cnpqdzBoZm15/LmpwZw" alt="Ana Isabel Carvalho e Ricardo Lafuente, from Manufactura Independente, sharing their experience as the creators and publsihers of Libre Graphics Magazine" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Due to room limitations and coronavirus restrictions, we directly invited 22 small media organizations, of which five were able to attend. The event gathered ten people.&lt;/p&gt;

&lt;h2&gt;
  
  
  Communications and marketing
&lt;/h2&gt;

&lt;p&gt;We cater for (what still is) a rather small community, and getting new contributors is our major struggle. In hindsight, we should have probably allocated some money towards marketing, and might do it in the future. We have done some posts on social media about GFTW and regularly update our followers on the work we develop for it. &lt;/p&gt;

&lt;p&gt;We were featured on multiple Portuguese media when we were announced as grantees, including &lt;a href="https://www.rtp.pt/noticias/economia/interruptor-ganha-bolsa-de-27-mil-euros-para-testar-monetizacao-de-conteudos-online_n1328296"&gt;RTP&lt;/a&gt;, &lt;a href="https://www.dinheirovivo.pt/empresas/interruptor-ganha-bolsa-de-27-mil-euros-para-testar-monetizacao-de-conteudos-online-13843561.html"&gt;Dinheiro Vivo&lt;/a&gt;, &lt;a href="https://mediaalternativos.pt/2021/06/interruptor-grant-for-the-web/"&gt;Media Alternativos&lt;/a&gt; and &lt;a href="https://www.meiosepublicidade.pt/2021/06/revista-interruptor-ganha-bolsa-de-27-mil-euros-para-testar-monetizacao-de-conteudo-online/"&gt;Meios &amp;amp; Publicidade&lt;/a&gt;, who also &lt;a href="(https://www.meiosepublicidade.pt/registo/?id=262602)"&gt;interviewed&lt;/a&gt; our director, Rute Correia, and &lt;a href="https://community.webmonetization.org/kult"&gt;Kult&lt;/a&gt;'s director, Patrick Rahy, about the plans for the grant.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s next?
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;TO DO&lt;/em&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Record audio articles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will start releasing audio articles in January.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Community events&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We still have two events to host. The next one will happen in late January and will be focused on experiences with Web Monetization. For this event, we will be sharing our own experience with implementing the technology and we invited &lt;a href="https://community.webmonetization.org/patrickrahy"&gt;Patrick Rahy&lt;/a&gt; to also share how they are doing things at Kult.&lt;/p&gt;

&lt;p&gt;There will be one final event in late February.&lt;/p&gt;

&lt;h2&gt;
  
  
  What community support would benefit your project?
&lt;/h2&gt;

&lt;p&gt;Spreading the word about Interruptor's work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional comments
&lt;/h2&gt;

&lt;p&gt;Since July, we have published 29 articles, including seven original data-driven full-features, 16 issues of our weekly newsletter with cultural recommendations and a series about minority languages. All the content is published under Creative Commons.&lt;/p&gt;

&lt;p&gt;We have also &lt;a href="https://github.com/InterruptorPt/dados"&gt;openly released multiple datasets&lt;/a&gt; that we compiled for our investigations. &lt;/p&gt;

</description>
      <category>grantreports</category>
    </item>
    <item>
      <title>Web Monetization on Interruptor is live! 🎉</title>
      <dc:creator>Ciaran</dc:creator>
      <pubDate>Fri, 23 Jul 2021 17:16:30 +0000</pubDate>
      <link>https://community.interledger.org/interruptor/web-monetization-on-interruptor-is-live-5h67</link>
      <guid>https://community.interledger.org/interruptor/web-monetization-on-interruptor-is-live-5h67</guid>
      <description>&lt;p&gt;It took us a little while to get our Uphold account set up and approved, but once we managed to get our payment pointer, integrating Web Monetization was pretty easy: just adding the &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag with our payment pointer to each of our pages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"monetization"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"$ilp.uphold.com/nzj2HrUbBDKa"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're not looking to put Interruptor's content behind a pay wall, so we'll be working to create &lt;em&gt;extra&lt;/em&gt; features for people supporting us through Web Monetization as a way to say thanks.&lt;/p&gt;

&lt;p&gt;In the meantime, we've set up the site to &lt;em&gt;actually&lt;/em&gt; say "thanks" when someone uses the site with Web Monetization activated.&lt;/p&gt;

&lt;p&gt;Our site is made with TypeScript, React and NextJS, so we made a &lt;code&gt;useWebMonetizationState&lt;/code&gt; hook to check when WM is activated:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;MonetizationEventMap&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MonetizationEventType&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MonetizationObject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;MonetizationState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@webmonetization/types&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;TEventListener&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@webmonetization/types/build/genericEventListeners&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;atom&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useAtom&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;jotai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Add Web Monetization to the global types
 */&lt;/span&gt;
&lt;span class="kr"&gt;declare&lt;/span&gt; &lt;span class="nb"&gt;global&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Document&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;monetization&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;MonetizationObject&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Add the event listener and return a function for removing it later
 */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;addEventListener&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;TEvent&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;MonetizationEventType&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;eventListener&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;TEventListener&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MonetizationEventMap&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;TEvent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monetization&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;eventListener&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;passive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;})&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;monetization&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;removeEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;eventListener&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * Create the atom where we'll store the current monetization state
 */&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;webMonetizationStateAtom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;atom&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;MonetizationState&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pending&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useWebMonetizationState&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;MonetizationState&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useAtom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;webMonetizationStateAtom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onStart&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;started&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;onStop&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;stopped&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;events&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
      &lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monetizationstart&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onStart&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monetizationprogress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onStart&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monetizationstop&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;onStop&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;removeListener&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;removeListener&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For now, since the only thing we're checking is whether it's started, we created a separate hook for that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;useHasWebMonetizationStarted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;boolean&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useWebMonetizationState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;state&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;started&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then use that hook in a component so that we can show the thank-you message when payments are being sent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useTranslation&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-i18next&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;toast&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-toastify&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;trackEvent&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utils/analytics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useHasWebMonetizationStarted&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utils/monetization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;WebMonetizationToaster&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;FC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useTranslation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;monetization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hasStarted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useHasWebMonetizationStarted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;hasStarted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;// Show the thank-you message&lt;/span&gt;
    &lt;span class="nx"&gt;toast&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;success&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;thanks&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;hasStarted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;t&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;hasStarted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;

    &lt;span class="c1"&gt;// Send an event to Plausible so we can see how many visitors use it&lt;/span&gt;
    &lt;span class="nx"&gt;trackEvent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;AnalyticsEvent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WEB_MONETIZATION_ACTIVE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;hasStarted&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It might get refactored a bit in the future, but for now it's working, which is the most important thing!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
