fundme
Version:
A simple but powerful client-side library to manage monetization on the web.
36 lines (31 loc) • 1.07 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Web Monetization API test!</title>
<meta name="monetization" content />
</head>
<body>
<h1 id="text">Loading...</h1>
<!--
below is a script tag with JSON type
the script tag must have fundme attribute so
Fundme.js can recognize it
-->
<script fundme type="application/json">
"$wallet.example.com/address"
</script>
<script src="../../dist/fundme-iife.js"></script>
<script>
fundme.fund()
// code below are optional, just to show that fundme is working
if (document.monetization) {
const address = document.querySelector('meta[name="monetization"]').content
document.getElementById('text').innerText = `Browser is streaming to ${address}`
} else {
document.getElementById('text').innerText = `Coil extension not found.`
}
</script>
</body>
</html>