Introduction to the

Web Monetization API

Mozilla Tech Speakers

Andrzej Mazur@end3rEnclave Games
Tech Speakers Briefing, online, May 21st 2020

June 2019: W3C Games workshop

Discoverability and Monetization

github.com/js13kgames

Monetized website


							<!DOCTYPE HTML>
							<html>
							<head>
							  <meta charset="utf-8">
							  <title>Flood Escape</title>
							  <meta name="monetization" content="your_payment_pointer">
							  // ...
							</head>
						
$coil.xrptipbot.com/-CgHpYu7SfeoDmHVugOfrw

Real-time money transfer

$5 / month

Detecting active subscribers

Checking the state


							if(document.monetization && document.monetization.state === 'started') {
							  // do something
							}
						

Listening for an event


							function startEventHandler(event) {
							  // do something
							}
							document.monetization.addEventListener('monetizationstart', startEventHandler);

Extra content

Levels, points, coins, weapons, bonuses, etc...

No advertisements

  • No privacy issues
  • No spying on users
  • No selling data

Full control

  "Classic" publisher Web Monetization
Implementation: Complicated, changing code 1 line of HTML + 2 lines of JS
Income: Waiting months for reports Instant, streamed in real time

Monetize all the things

  • Games
  • Articles (WordPress)
  • Videos (YouTube, Cinnamon)
  • Podcasts
  • Tools
  • Services
  • Anything else on the Web

Go out and

build the future

of the Web!

Ender Efka @end3r