diff --git a/src/config.ts b/src/config.ts index 10ca390e9e..374d55b719 100644 --- a/src/config.ts +++ b/src/config.ts @@ -220,6 +220,21 @@ export interface Config { * However, if you’d like, you can disable this feature and prevent Prebid.js from using anything but the latest bids for a given auction. */ useBidCache?: boolean; + /** + * When Bid Caching is turned on, a custom Filter Function can be defined to gain more granular control over which “cached” bids can be used. + * This function will only be called for “cached” bids from previous auctions, not “current” bids from the most recent auction. + * The function should take a single bid object argument, and return true to use the cached bid, or false to not use the cached bid. + * + * For Example, to turn on Bid Caching, but exclude cached video bids, you could do this: + * + * ``` + * pbjs.setConfig({ + * useBidCache: true, + * bidCacheFilterFunction: bid => bid.mediaType !== 'video' + * }); + * ``` + */ + bidCacheFilterFunction?: (bid: Bid) => boolean; /** * You can prevent Prebid.js from reading or writing cookies or HTML localstorage by setting this to false. */