Skip to main content

Amazon Publisher Services

Amazon Publisher Services (APS) allows publishers to use a Client-to-Server (C2S) call that returns bid information to be passed to your publisher ad server. The client application, deployed on Amazon Fire TV or Fire Tablet devices, constructs an APSBidRequest and sends it to the APS service. This integration is available on Android only.

Overview

APS enables publishers to:

  • Request programmatic bids from Amazon's ad system
  • Pass bid responses to your ad server or SSAI provider
  • Optimize ad delivery on Fire TV and Fire Tablet devices
  • Support both VOD and Live content streams

Prerequisites

  • Amazon Fire TV or Fire Tablet device (Android)
  • APS service access credentials
  • Familiarity with your ad server or SSAI provider integration

Basic Setup

Step 1: Create the APS Bid Request

Import the required APS types and construct your bid request:

import {
APSVideoImpression,
APSDeviceInfo,
APSContent,
APSApplication,
APSBidRequest,
bidService,
} from '@quickplay/rn-qp-nxg-player';

// Define video impressions (ad slots)
const videoImpressions: APSVideoImpression[] = [
{
width: 540,
height: 960,
slotID: '<slot-id-1>',
},
{
width: 540,
height: 960,
slotID: '<slot-id-2>',
},
];

// Define device information
const deviceInfo: APSDeviceInfo = {
userAgent: '<your-app-user-agent>',
privacyRule: 'TRACKING_UNRESTRICTED',
advertisingID: '<device-advertising-id>',
language: 'en',
};

// Define content metadata
const contentInfo: APSContent = {
id: '<content-id>',
rating: 'TV-G',
genre: 'Adventure',
channel: '<channel-name>',
length: '<duration-in-seconds>',
language: 'en',
};

// Define application information
const applicationInfo: APSApplication = {
id: '<app-id>',
name: '<app-name>',
domain: '<app-domain>',
bundle: '<bundle-id>',
storeURL: '<store-url>',
content: contentInfo,
inventoryPartnerDomain: '<ipd-domain>',
};

// Construct the APS bid request
const request: APSBidRequest = {
id: '<unique-request-id>',
application: applicationInfo,
device: deviceInfo,
videoImpressions: videoImpressions,
privacyToken: '<privacy-token>',
};

Step 2: Request Bids from APS

Call getAmazonPublisherServicesBids to retrieve bid responses:

const apsUrl = 'https://aax-ott-c2s.amazon-adsystem.com/e/c2s/ads';
const response = await bidService.getAmazonPublisherServicesBids(apsUrl, request);

The response is a key-value pair containing bid information to be passed to your ad server or SSAI provider.

VOD Integration

For Video on Demand content, pass the APS bid response as adTagParameters in the player configuration:

const playerConfig: PlayerConfig = {
mediaURL: '<content-url>',
contentType: 'VOD',
mediaType: 'HLS',
// ... other config
adTagParameters: response, // Pass APS bid response
};

const player = await createPlayer(playerConfig);
await player.play();

Live Integration

For live streams, update the ad tag dynamically using the replaceAdTag API. Call this at each ad break start:

// Create player
const playerConfig: PlayerConfig = {
mediaURL: '<live-stream-url>',
contentType: 'LIVE',
mediaType: 'HLS',
// ... other config
};

const player = await createPlayer(playerConfig);

// Replace ad tags at each ad break
const apsUrl = 'https://aax-ott-c2s.amazon-adsystem.com/e/c2s/ads';
const response = await bidService.getAmazonPublisherServicesBids(apsUrl, request);
await player.replaceAdTag(response);

Important Notes

Do not reuse APS bids

Always call getAmazonPublisherServicesBids() on every playback start for VOD content and at every ad break start for live streams. Do not reuse previous bid responses, as they may have expired or become invalid.

APS Request Parameters Reference

APSDeviceInfo

PropertyTypeRequiredDescription
userAgentstringYesApplication's user-agent string
privacyRulestringYesPrivacy setting: 'TRACKING_UNRESTRICTED' (most common)
advertisingIDstringYesDevice advertising identifier
languagestringYesDevice language code (e.g., 'en')

APSContent

PropertyTypeRequiredDescription
idstringYesUnique content identifier
ratingstringNoContent rating (e.g., 'TV-G', 'PG-13')
genrestringNoContent genre
channelstringNoChannel or category name
lengthstringNoContent duration in seconds
languagestringNoContent language code

APSApplication

PropertyTypeRequiredDescription
idstringYesUnique application identifier
namestringYesApplication name
domainstringYesApplication domain
bundlestringYesApplication bundle ID
storeURLstringYesLink to app store listing
contentAPSContentNoContent metadata object
inventoryPartnerDomainstringNoInventory partner domain

APSVideoImpression

PropertyTypeRequiredDescription
widthnumberYesAd slot width in pixels
heightnumberYesAd slot height in pixels
slotIDstringYesUnique ad slot identifier

APSBidRequest

PropertyTypeRequiredDescription
idstringYesUnique bid request ID (recommend: UUID + timestamp)
applicationAPSApplicationYesApplication information
deviceAPSDeviceInfoYesDevice information
videoImpressionsAPSVideoImpression[]YesArray of ad slot definitions
privacyTokenstringNoPrivacy consent token