fundme
Version:
A simple but powerful client-side library to manage monetization on the web.
33 lines (28 loc) • 1.05 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>
<template fundme>
$wallet.example.com/this-address-has-ten-weight#10;
$wallet.example.com/this-address-has-twenty-two-weight#22;
$wallet.example.com/this-address-has-fifty-five-weight#55;
</template>
<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>