swirl some coin in your cup
swrlit-monetize
combines the power of useSWR
with magic of Inrupt's lit-pod
solid-client
and
the revolutionary potential of Web Monetization to make it easy to monetize your React apps.
This library provides a single React hook that will pull your Interledger Payment Pointer from your Solid WebID Profile. To configure your payment pointer you can use Understory Garden or a number of other Solid applications.
see the examples below
npm install swrlit-monetize
Assuming you have configured your Solid Pod Profile with a Payment Pointer you can use the usePaymentPointer
hook to
create a meta tag that will monetize your page:
import { usePaymentPointer } from "swrlit-monetize"
import Head from 'next/head'
export default function Page({}){
const webId = "https://travis.myunderstory.com/profile/card#me"
const paymentPointer = usePaymentPointer(webId)
return (
<>
<Head>
<meta name="monetization" content={paymentPointer} />
</Head>
<p>this page is monetized for {paymentPointer}</p>
</>
)
}