1.1.9 • Published 4 months ago
prism-sdk v1.1.9
Importing and Initializing PrismClient
Prism Engine finds high-value users for your campaign using on-chain data. Compete in a real-time auction and display your ads to relevant users
Auth
- Api Key: Please refer to the Prism Protocol documentation for more information on how to get an API KEY & get whitelisted as publisher.
- Address whitelisted: Please refer to the Prism Protocol documentation for more information on how to get whitelisted as publisher.
Publisher sdk demo
- Publisher website
- Implementation example with NextJS
Two options to integrate with Prism Protocol
- By using the PrismClient SDK
- By using the Prism Publisher API
Prism SDK
- Install the prism-sdk
npm install prism-sdk
- Import the PrismClient
import { PrismClient } from 'prism-sdk';
- Class functions
// Initialize the PrismClient
- constructor(apiKey: string);
// To be called when publisher wants to trigger an auction to display an ad
triggerAuction(publisher: string, wallet: string, websiteUrl: string);
// To be called when the user clicks on the ad (img onClick())
handleUserClick(publisher: string, websiteUrl: string, winnerId: any);
// To be called when the user views the ad (img onLoad())
sendViewedFeedback(publisher: string, websiteUrl: string, winnerId: any);
Auction
- Initialize the
PrismClient
with your publisher address;
- Ensure Publisher is whitelisted in the Prism contract before initializing the
PrismClient
const prismClient = new PrismClient(API_KEY); const result = await prismClient.triggerAuction(WALLET_ADDRESS, PUBLISHER_WL_ADDRESS, DOMAIN_URL);
- Important: The methods on the
PrismClient
must 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.
Prism Publisher API
API Key
- ⚠️ Ensure to add the header: 'x-api-key': , in all requests ⚠️
1.1.9
4 months ago
1.1.8
4 months ago
1.1.7
4 months ago
1.1.6
5 months ago
1.1.5
5 months ago
1.1.4
5 months ago
1.1.3
5 months ago
1.1.2
5 months ago
1.1.1
5 months ago
1.1.0
5 months ago
1.0.9
5 months ago
1.0.8
5 months ago
1.0.7
5 months ago
1.0.6
5 months ago
1.0.5
5 months ago
1.0.4
5 months ago
1.0.3
5 months ago
1.0.2
5 months ago
1.0.1
5 months ago
1.0.0
5 months ago