Skip to content

A Web Monetization meta manager for React. It takes a Payment pointer and outputs plain HTML Web monetization meta tag. It's dead simple, and React beginner-friendly.

License

Notifications You must be signed in to change notification settings

uchibeke/react-web-monetization-meta

Repository files navigation

react-webmonetization-meta

Web monetization for React apps: This reusable React component will add a custom Web Monetization payment pointer to the document head. React Web Monetization takes a Payment pointer and outputs plain HTML Web monetization meta tag. It's dead simple, and React beginner friendly.

NPM JavaScript Style Guide CLA assistant

Installation

Yarn:

yarn add react-webmonetization-meta

npm:

npm install --save react-webmonetization-meta

Usage - Enabling Web Monetization

import React, { Component } from 'react'

import ReactWebMonetizationMeta from 'react-webmonetization-meta'

const Example = () => {
  // Change to:
  //   your Interledger payment pointer or
  //   the Interledger payment pointer of your user or
  //   the Interledger payment pointer of the content creator
  const PaymentPointer = '$ilp.uphold.com/B3wYJrpHiUyQ'
  return (
    <div>
      Some JSX
      <ReactWebMonetizationMeta PaymentPointer={PaymentPointer} />
      Some other JSX
    </div>
  )
}

result (in console):

<head>
  <title>react-webmonetization-meta</title>
  <meta name="monetization" content="$ilp.uphold.com/B3wYJrpHiUyQ" />
</head>

See below for a full reference guide.

Features

  • Supports customization of monetization pointer
  • Nested components override duplicate Web monetization metas.

Contributing to this project

Please take a moment to review the guidelines for contributing.

License

MIT © uchibeke

About

A Web Monetization meta manager for React. It takes a Payment pointer and outputs plain HTML Web monetization meta tag. It's dead simple, and React beginner-friendly.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published