A Gatsby plugin for react-monetize to speed up your integration with Web Monetization API
yarn add gatsby-plugin-monetization
Or
npm install --save gatsby-plugin-monetization
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',
},
},
],
};
To setup playground locally, run following commands (without -) in sequence:
- git clone [email protected]:mrmuhammadali/gatsby-plugin-monetization.git
- cd gatsby-plugin-monetization/examples
- yarn install
- yarn start
👤 Muhammad Ali [email protected]
- Twitter: @muhammadali_io
- Github: @mrmuhammadali
react-monetize Author
👤 Guido Vizoso [email protected]
- Twitter: @guido_vizoso
- Github: @guidovizoso
Give a ⭐️ if this project helped you!
MIT