Superfluid Subscription Widget for Lens handle holders
this repo will demonstrate how to use the Superfluid subscription wallet with a Vite/ react app. You will be able to make a stream and I will show you how to restrict the payment option for .Lens handle holders only.
We will use Polygon Mumbai for this example.
We will use the following web3 dependencies and libraries:
- Wagmi
- Superfluid subscription widget
- Rainbow Kit
- Lens SDK
This is a good use case for content creators to get paid on socials.
Create a new directory for your project and create a new React app.
Please note that I use Vite.js but you can also create a React.js or React/typescript See the Vite documentation for the #yarn or #pnpm commands
mkdir my-dapp
cd my-dapp
npm create vite@latest my-dapp --template react
Next, install the superfluid subscription widget as a dependency in your project using the command:
#npm
npm install --save @superfluid-finance/widget wagmi @superfluid-finance/tokenlist
#yarn
yarn add @superfluid-finance/widget wagmi @superfluid-finance/tokenlist
RainbowKit is a React library and out-of-the-box wallet management for your dapp.
npm install @rainbow-me/rainbowkit wagmi viem
It’s very easy to set up 👉 follow these steps : https://www.rainbowkit.com/docs/installation
Before you include the widget in your file, you'll need to generate JSON that you'll pass as a prop to the widget component. This JSON specifies most of your widget's properties, and you can use our hosted, no-code widget builder to visually see what your widget will look like. You can find the widget builder here.
- For this, we will need to install the LensClient SDK.
npm install @lens-protocol/client