DEV Community

Peter Chan
Peter Chan

Posted on

a Weather App with Monetization Feature

[Instructions]: While I am still waiting for the free-trial account Coil, I am trying to build something basic but meaningful for experimenting with the Monetization API.

What I built

  • a Simple Weather App with Monetization Feature
  • Currently, if the Monetization API along Coil plugin at the client side is properly implemented, a "Thank you" message will be displayed
  • If the client does not implement Monetization feature on his/her browser, the "Monetization Feature Available" message will be shown instead

Submission Category: Exciting Experiments

Demo

App

Link to Code

Repo

How I built it

I implement this application by React.js with Hooks. Realtime weather info is fetched on OpenWeather API. The Application is styled by CSS along with Bootstrap.

Additional Resources/Info

Deployed Demo on now.sh

Top comments (1)

Collapse
 
cyberdees profile image
☞ Desigan Chinniah ☜

Quick feedback. I seem to get the same Monetization Feature Available message in both scenarios right now ie. with or without a Web Monetization provider (Coil) membership.

Are you perhaps correctly checking for 'monetizationstart'?

if (document.monetization) {
  document.monetization.addEventListener('monetizationstart', () => {
    document.getElementById('exclusive').classList.remove('hidden')
  })
}