Skip to main content

MonetizationEvent.amount

Caution

The amount property is deprecated. Please consider using the amountSent property of the MonetizationEvent interface instead.

The amount property of the MonetizationEvent interface returns the amount of money that was successfully received on the last payment.

Value

An integer representing the amount of money received.

Examples

<link rel="monetization" href="https://example.com/pay" />
<script>
const link = document.querySelector('link[rel="monetization"]')
link.addEventListener('monetization', (event) => {
// See how much your received and in what currency
const { amount, assetCode, assetScale } = event
console.log(`Browser sent ${assetCode}${amount / Math.pow(10, assetScale)}.`)
})
</script>

Specifications

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Internet Explorer
Opera
Safari
WebView Android
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
Puma Browser
amount
YesYesYesNoYesNoNoNoNoNoNoNoYes
Full Support
No Support
You'll need to use a Web Monetization Extension