1.1.9 • Published 4 months ago

prism-sdk v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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

Publisher sdk demo

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

  1. 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);
  1. 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.

Dashboard

Prism Publisher API

API Key

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