Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

awscdk-construct-ad-decision-server

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

awscdk-construct-ad-decision-server

AWS CDK Construct to upload local files to S3 and make them publicly available via CloudFront

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-44.44%
Maintainers
0
Weekly downloads
 
Created
Source

awscdk-construct-ad-decision-server

View on Construct Hub

CDK Construct for setting up a simple Ad Decision Server (ADS)

  • Specify a list of ad creative files
  • AdDecisionServer creates an API Gateway endpoint backed by a Lambda function that returns a VAST file based on the duration of the ad break
  • The ad break's duration (in sec) needs to be specified as a query string (e.g. "?duration=30")
  • The Lambda function generates a VAST file using the creatives that fills the ad break
  • If clearanceRule: 'SEQUENCIAL' is set, the Lambda function tries to fill the ad break with the ad creatives from the beginning and gives up when there's no more space in the ad break.
  • If clearanceRule: 'LONGEST_FIRST' (default) is set, the Lambda function tries to fill the ad break using the longest ad creative and, when the remaining break does not fit the longest ad, it moves to the 2nd longest ad creative.

Install

NPM

Usage

import * as cdk from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { AdDecisionServer } from 'awscdk-construct-ad-decision-server';

export class ExampleStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    // Build an Ad Decision Server (ADS) that returns 3x creatives
    const ads = new AdDecisionServer(this, 'AdDecisionServer', {
      creatives: [
        {
          duration: 30,
          url: `${AD_CREATIVE_URL}/30sec.mp4`,
          delivery: 'progressive',
          mimeType: 'video/mp4',
          width: 1280,
          height: 720,
        },
        {
          duration: 15,
          url: `${AD_CREATIVE_URL}/15sec.mp4`,
          delivery: 'progressive',
          mimeType: 'video/mp4',
          width: 1280,
          height: 720,
        },
        {
          duration: 60,
          url: `${AD_CREATIVE_URL}/60sec.mp4`,
          delivery: 'progressive',
          mimeType: 'video/mp4',
          width: 1280,
          height: 720,
        },
      ],
      clearanceRule: 'SEQUENCIAL', // Specify how ADS clear inventory: LONGEST_FIRST (defalut) or SEQUENCIAL
    });

    // You can use the ADS with MediaTailor
    const {emt, cf} = new MediaTailorWithCloudFront(this, 'MediaTailorWithCloudFront', {
      videoContentSourceUrl: ORIGIN_URL,
      adDecisionServerUrl: `${ads.url}?duration=[session.avail_duration_secs]`,
      slateAdUrl: SLATE_URL,
    });
  }
}

Keywords

FAQs

Package last updated on 01 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc