Before you can use the PrismClient, ensure that the publisher address and publisher website URL are whitelisted by the Prism Protocol team. This is essential to utilize the SDK for publishing ads and generating revenue.
Prism Accounting contract on bartio network: 0x82ff01DA9a64dFd05156277b5f0eF1d4Cc6d767B
To import and initialize the PrismClient, follow these steps:
-
Import the
PrismClientin your component:import { PrismClient } from '../../../src/PrismClient';
-
Initialize the
PrismClientwith your publisher address and website URL:const prismClient = new PrismClient(publisherReceiverAddress, examplePublishingWebsite);
-
Important: The methods on the
PrismClientmust be called to submit feedback, reviews, and clicks. This is crucial for tracking the analytics of your publishing websites and the displayed ads on the Prism Protocol publishers' space. Additionally, it allows you to claim the profit as a publisher.
Make sure to handle the responses from these methods appropriately to ensure accurate tracking and feedback submission.
This is a RainbowKit + wagmi + Next.js project bootstrapped with create-rainbowkit.
First, run the development server:
npm run devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying pages/index.tsx. The page auto-updates as you edit the file.
To run the example app, follow these steps:
-
Ensure you have all dependencies installed by running:
npm install
-
Start the development server:
npm run dev
-
Open http://localhost:3002 in your browser to view the example app.
To learn more about this stack, take a look at the following resources:
- RainbowKit Documentation - Learn how to customize your wallet connection flow.
- wagmi Documentation - Learn how to interact with Ethereum.
- Next.js Documentation - Learn how to build a Next.js application.
You can check out the RainbowKit GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out the Next.js deployment documentation for more details.