Skip to content

mrmuhammadali/gatsby-plugin-monetization

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

gatsby-plugin-monetization

A Gatsby plugin for react-monetize to speed up your integration with Web Monetization API

Install

yarn add gatsby-plugin-monetization

Or

npm install --save gatsby-plugin-monetization

How to use

You can read how to get your payment pointer on official website of Web Monetization API.

import { useContent, useStatus } from 'gatsby-plugin-monetization';

function MyComponent() {
    // ...
    const { state, events } = useStatus();
    const { isMonetized } = useContent();
    // ...
}

./gatsby-config.js

module.exports = {
    plugins: [
        {
            resolve: `gatsby-plugin-monetization`,
            options: {
                // [required]
                paymentPointer: 'your-payment-pointer',
            },
        },
    ],
};

Examples

To setup playground locally, run following commands (without -) in sequence:

- git clone git@github.com:mrmuhammadali/gatsby-plugin-monetization.git
- cd gatsby-plugin-monetization/examples
- yarn install
- yarn start

Author

👤 Muhammad Ali hi@muhammadali.dev

react-monetize Author

👤 Guido Vizoso guido.vizoso9@gmail.com

Show your support

Give a ⭐️ if this project helped you!

License

MIT

About

Gatsby plugin for integration of Web Monetization API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published