@mediarithmics/plugins-nodejs-sdk
Version:
This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate
24 lines (23 loc) • 1.43 kB
TypeScript
import { ItemProposal, UserCampaignResource } from '../../../index';
import { AdRendererTemplateInstanceContext, AdRendererTemplatePlugin } from '../template/AdRendererTemplatePlugin';
export interface AdRendererRecoTemplateInstanceContext extends AdRendererTemplateInstanceContext {
recommender_id?: string;
}
export declare abstract class AdRendererRecoTemplatePlugin extends AdRendererTemplatePlugin {
constructor(enableThrottling?: boolean);
/**
* Helper to fetch the User Campaign
* @param campaignId The campaignId -> should come from the AdRendererRequest
* @param userCampaignId The userCampaignId -> should come from the AdRendererRequest
* @returns A Promise of the User Campaign
*/
fetchUserCampaign(campaignId: string, userCampaignId: string): Promise<UserCampaignResource>;
/**
* Helper to fetch the User recommendations
* @param instanceContext The instanceContext -> contains the recommender_id of the creative
* @param userAgentId The userAgentId as a string -> should come from the AdRendererRequest (recommended) or from the UserCampaign
* @returns A Promise of the Recommendations
*/
fetchRecommendations(instanceContext: AdRendererRecoTemplateInstanceContext, userAgentId: string): Promise<Array<ItemProposal>>;
protected instanceContextBuilder(creativeId: string): Promise<AdRendererRecoTemplateInstanceContext>;
}